Package io.dialob.program.expr.arith
Class ImmutableFormatOperator
- java.lang.Object
-
- io.dialob.program.expr.arith.ImmutableFormatOperator
-
- All Implemented Interfaces:
FormatOperator,Expression,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableFormatOperator extends Object implements FormatOperator
Immutable implementation ofFormatOperator.Use the builder to create immutable instances:
ImmutableFormatOperator.builder(). Use the static factory method to create immutable instances:ImmutableFormatOperator.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableFormatOperator.BuilderBuilds instances of typeImmutableFormatOperator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableFormatOperator.Builderbuilder()Creates a builder forImmutableFormatOperator.static ImmutableFormatOperatorcopyOf(FormatOperator instance)Creates an immutable copy of aFormatOperatorvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableFormatOperatorthat have equal attribute values.ExpressiongetExpression()StringgetFormat()inthashCode()Computes a hash code from attributes:expression,format.static ImmutableFormatOperatorof(Expression expression, String format)Construct a new immutableFormatOperatorinstance.StringtoString()Prints the immutable valueFormatOperatorwith attribute values.ImmutableFormatOperatorwithExpression(Expression value)Copy the current immutable object by setting a value for theexpressionattribute.ImmutableFormatOperatorwithFormat(String value)Copy the current immutable object by setting a value for theformatattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.dialob.program.expr.arith.FormatOperator
eval, getEvalRequiredConditions, getValueType
-
-
-
-
Method Detail
-
getExpression
public Expression getExpression()
- Specified by:
getExpressionin interfaceFormatOperator- Returns:
- The value of the
expressionattribute
-
getFormat
public String getFormat()
- Specified by:
getFormatin interfaceFormatOperator- Returns:
- The value of the
formatattribute
-
withExpression
public final ImmutableFormatOperator withExpression(Expression value)
Copy the current immutable object by setting a value for theexpressionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for expression- Returns:
- A modified copy of the
thisobject
-
withFormat
public final ImmutableFormatOperator withFormat(String value)
Copy the current immutable object by setting a value for theformatattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for format- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableFormatOperatorthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:expression,format.
-
toString
public String toString()
Prints the immutable valueFormatOperatorwith attribute values.
-
of
public static ImmutableFormatOperator of(Expression expression, String format)
Construct a new immutableFormatOperatorinstance.- Parameters:
expression- The value for theexpressionattributeformat- The value for theformatattribute- Returns:
- An immutable FormatOperator instance
-
copyOf
public static ImmutableFormatOperator copyOf(FormatOperator instance)
Creates an immutable copy of aFormatOperatorvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable FormatOperator instance
-
builder
public static ImmutableFormatOperator.Builder builder()
Creates a builder forImmutableFormatOperator.ImmutableFormatOperator.builder() .expression(io.dialob.program.model.Expression) // requiredexpression.format(String) // requiredformat.build();- Returns:
- A new ImmutableFormatOperator builder
-
-