/** * Initiate the building of a new <code>Operation</code>. The <code>Operation</code> building will be complete when calling the {@link #done()} method. * * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder createNewInstance() { operation = new OperationImpl(); return this; }
/** * Sets the <code>LeftOperand</code> of this operation. A <code>LeftOperand</code> can be obtained by using <code>LeftOperandBuilder</code>. * * @param leftOperand * the <code>LeftOperand</code> to set. * @return this builder itself, so that calls the various exposed methods can be chained. * @see LeftOperandBuilder */ public OperationBuilder setLeftOperand(final LeftOperand leftOperand) { operation.setLeftOperand(leftOperand); return this; }
/** * @param operator * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder setOperator(final String operator) { operation.setOperator(operator); return this; }
@Override public Operation copy() { try { final OperationImpl clone = (OperationImpl) clone(); if (getRightOperand() != null) { clone.setRightOperand(getRightOperand().copy()); } return clone; } catch (CloneNotSupportedException e) { return null; } }
public static Operation toOperation(final SOperation operation) { final OperationImpl operationImpl = new OperationImpl(); operationImpl.setRightOperand(toExpression(operation.getRightOperand())); operationImpl.setOperator(operation.getOperator()); operationImpl.setType(toOperatorType(operation.getType())); final LeftOperandImpl leftOperand = new LeftOperandImpl(); final SLeftOperand sLeftOperand = operation.getLeftOperand(); leftOperand.setName(sLeftOperand.getName()); leftOperand.setType(sLeftOperand.getType()); operationImpl.setLeftOperand(leftOperand); return operationImpl; }
/** * @param operatorType * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder setType(final OperatorType operatorType) { operation.setType(operatorType); return this; }
/** * @param rightOperand * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder setRightOperand(final Expression rightOperand) { operation.setRightOperand(rightOperand); return this; }
/** * @param operatorInputType * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder setOperatorInputType(final String operatorInputType) { operation.setOperatorInputType(operatorInputType); return this; }
/** * @return the newly built <code>Operation</code>. */ public Operation done() { if (operation.getType() == null) { throw new IllegalStateException("The type of the expression is not set"); } return operation; }
public static Operation toOperation(final SOperation operation) { final OperationImpl operationImpl = new OperationImpl(); operationImpl.setRightOperand(toExpression(operation.getRightOperand())); operationImpl.setOperator(operation.getOperator()); operationImpl.setType(toOperatorType(operation.getType())); final LeftOperandImpl leftOperand = new LeftOperandImpl(); final SLeftOperand sLeftOperand = operation.getLeftOperand(); leftOperand.setName(sLeftOperand.getName()); leftOperand.setType(sLeftOperand.getType()); operationImpl.setLeftOperand(leftOperand); return operationImpl; }
@Override public Operation copy() { try { final OperationImpl clone = (OperationImpl) clone(); if (getRightOperand() != null) { clone.setRightOperand(getRightOperand().copy()); } return clone; } catch (CloneNotSupportedException e) { return null; } }
/** * @param operatorType * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder setType(final OperatorType operatorType) { operation.setType(operatorType); return this; }
/** * @param rightOperand * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder setRightOperand(final Expression rightOperand) { operation.setRightOperand(rightOperand); return this; }
/** * @param operatorInputType * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder setOperatorInputType(final String operatorInputType) { operation.setOperatorInputType(operatorInputType); return this; }
/** * @return the newly built <code>Operation</code>. */ public Operation done() { if (operation.getType() == null) { throw new IllegalStateException("The type of the expression is not set"); } return operation; }
/** * Sets the <code>LeftOperand</code> of this operation. A <code>LeftOperand</code> can be obtained by using <code>LeftOperandBuilder</code>. * * @param leftOperand * the <code>LeftOperand</code> to set. * @return this builder itself, so that calls the various exposed methods can be chained. * @see LeftOperandBuilder */ public OperationBuilder setLeftOperand(final LeftOperand leftOperand) { operation.setLeftOperand(leftOperand); return this; }
/** * @param operator * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder setOperator(final String operator) { operation.setOperator(operator); return this; }
/** * Initiate the building of a new <code>Operation</code>. The <code>Operation</code> building will be complete when calling the {@link #done()} method. * * @return this builder itself, so that calls the various exposed methods can be chained. */ public OperationBuilder createNewInstance() { operation = new OperationImpl(); return this; }
/** * @deprecated use setLeftOperand(String,String) * Sets the <code>LeftOperand</code> of this operation. It is built for you with its name and external properties. * @param name * the name of the left operand * @param external * is the data managed externally and thus should not be tried to be updated? * @return this builder itself, so that calls the various exposed methods can be chained. */ @Deprecated public OperationBuilder setLeftOperand(final String name, final boolean external) { operation.setLeftOperand(new LeftOperandBuilder().createNewInstance(name).setExternal(external).done()); return this; }
/** * @deprecated use setLeftOperand(String,String) * Sets the <code>LeftOperand</code> of this operation. It is built for you with its name and external properties. * @param name * the name of the left operand * @param external * is the data managed externally and thus should not be tried to be updated? * @return this builder itself, so that calls the various exposed methods can be chained. */ @Deprecated public OperationBuilder setLeftOperand(final String name, final boolean external) { operation.setLeftOperand(new LeftOperandBuilder().createNewInstance(name).setExternal(external).done()); return this; }