Class ImmutableConstant<T>
java.lang.Object
io.dialob.session.engine.program.expr.arith.ImmutableConstant<T>
- All Implemented Interfaces:
Constant<T>,Expression,Serializable
@Generated(from="Constant",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableConstant<T>
extends Object
implements Constant<T>
Immutable implementation of
Constant.
Use the builder to create immutable instances:
ImmutableConstant.builder().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ImmutableConstant.Builder<T> builder()Creates a builder forImmutableConstant.static <T> ImmutableConstant<T> Creates an immutable copy of aConstantvalue.booleanThis instance is equal to all instances ofImmutableConstantthat have equal attribute values.getValue()inthashCode()Computes a hash code from attributes:value,valueType.toString()Prints the immutable valueConstantwith attribute values.final ImmutableConstant<T> Copy the current immutable object by setting a value for thevalueattribute.final ImmutableConstant<T> withValueType(ValueType value) Copy the current immutable object by setting a value for thevalueTypeattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.dialob.session.engine.program.model.Expression
getEvalRequiredConditions
-
Method Details
-
getValue
-
getValueType
- Specified by:
getValueTypein interfaceConstant<T>- Specified by:
getValueTypein interfaceExpression- Returns:
- The value of the
valueTypeattribute
-
withValue
Copy the current immutable object by setting a value for thevalueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy or the
thisobject
-
withValueType
Copy the current immutable object by setting a value for thevalueTypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for valueType- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableConstantthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:value,valueType. -
toString
Prints the immutable valueConstantwith attribute values. -
copyOf
Creates an immutable copy of aConstantvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
T- generic parameter T- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Constant instance
-
builder
Creates a builder forImmutableConstant.ImmutableConstant.<T>builder() .value(T) // requiredvalue.valueType(io.dialob.rule.parser.api.ValueType) // requiredvalueType.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableConstant builder
-