Class ImmutableVariableReference<T>
java.lang.Object
io.dialob.session.engine.program.expr.arith.ImmutableVariableReference<T>
- All Implemented Interfaces:
VariableReference<T>,Expression,Serializable
@Generated(from="VariableReference",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableVariableReference<T>
extends Object
implements VariableReference<T>
Immutable implementation of
VariableReference.
Use the builder to create immutable instances:
ImmutableVariableReference.builder().
Use the static factory method to create immutable instances:
ImmutableVariableReference.of().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableVariableReference. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ImmutableVariableReference.Builder<T> builder()Creates a builder forImmutableVariableReference.static <T> ImmutableVariableReference<T> copyOf(VariableReference<T> instance) Creates an immutable copy of aVariableReferencevalue.booleanThis instance is equal to all instances ofImmutableVariableReferencethat have equal attribute values.inthashCode()Computes a hash code from attributes:valueType,itemId.static <T> ImmutableVariableReference<T> Construct a new immutableVariableReferenceinstance.toString()Prints the immutable valueVariableReferencewith attribute values.final ImmutableVariableReference<T> withItemId(ItemId value) Copy the current immutable object by setting a value for theitemIdattribute.final ImmutableVariableReference<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.expr.arith.VariableReference
eval, getEvalRequiredConditions
-
Method Details
-
getValueType
- Specified by:
getValueTypein interfaceExpression- Returns:
- The value of the
valueTypeattribute
-
getItemId
- Specified by:
getItemIdin interfaceVariableReference<T>- Returns:
- The value of the
itemIdattribute
-
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
-
withItemId
Copy the current immutable object by setting a value for theitemIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for itemId- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableVariableReferencethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:valueType,itemId. -
toString
Prints the immutable valueVariableReferencewith attribute values. -
of
Construct a new immutableVariableReferenceinstance.- Type Parameters:
T- generic parameter T- Parameters:
itemId- The value for theitemIdattributevalueType- The value for thevalueTypeattribute- Returns:
- An immutable VariableReference instance
-
copyOf
Creates an immutable copy of aVariableReferencevalue. 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 VariableReference instance
-
builder
Creates a builder forImmutableVariableReference.ImmutableVariableReference.<T>builder() .valueType(io.dialob.rule.parser.api.ValueType) // requiredvalueType.itemId(io.dialob.session.engine.session.model.ItemId) // requireditemId.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableVariableReference builder
-