Package io.dialob.program.expr.arith
Class ImmutableContextVariableReference<T>
- java.lang.Object
-
- io.dialob.program.expr.arith.ImmutableContextVariableReference<T>
-
- All Implemented Interfaces:
ContextVariableReference<T>,Expression,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableContextVariableReference<T> extends Object implements ContextVariableReference<T>
Immutable implementation ofContextVariableReference.Use the builder to create immutable instances:
ImmutableContextVariableReference.builder(). Use the static factory method to create immutable instances:ImmutableContextVariableReference.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableContextVariableReference.Builder<T>Builds instances of typeImmutableContextVariableReference.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ImmutableContextVariableReference.Builder<T>builder()Creates a builder forImmutableContextVariableReference.static <T> ImmutableContextVariableReference<T>copyOf(ContextVariableReference<T> instance)Creates an immutable copy of aContextVariableReferencevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableContextVariableReferencethat have equal attribute values.ItemIdgetItemId()ValueTypegetValueType()inthashCode()Computes a hash code from attributes:valueType,itemId.static <T> ImmutableContextVariableReference<T>of(ItemId itemId, ValueType valueType)Construct a new immutableContextVariableReferenceinstance.StringtoString()Prints the immutable valueContextVariableReferencewith attribute values.ImmutableContextVariableReference<T>withItemId(ItemId value)Copy the current immutable object by setting a value for theitemIdattribute.ImmutableContextVariableReference<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, wait
-
Methods inherited from interface io.dialob.program.expr.arith.ContextVariableReference
eval, getEvalRequiredConditions
-
-
-
-
Method Detail
-
getValueType
public ValueType getValueType()
- Specified by:
getValueTypein interfaceExpression- Returns:
- The value of the
valueTypeattribute
-
getItemId
public ItemId getItemId()
- Specified by:
getItemIdin interfaceContextVariableReference<T>- Returns:
- The value of the
itemIdattribute
-
withValueType
public final ImmutableContextVariableReference<T> withValueType(ValueType value)
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 of the
thisobject
-
withItemId
public final ImmutableContextVariableReference<T> withItemId(ItemId value)
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 of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableContextVariableReferencethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:valueType,itemId.
-
toString
public String toString()
Prints the immutable valueContextVariableReferencewith attribute values.
-
of
public static <T> ImmutableContextVariableReference<T> of(ItemId itemId, ValueType valueType)
Construct a new immutableContextVariableReferenceinstance.- Type Parameters:
T- generic parameter T- Parameters:
itemId- The value for theitemIdattributevalueType- The value for thevalueTypeattribute- Returns:
- An immutable ContextVariableReference instance
-
copyOf
public static <T> ImmutableContextVariableReference<T> copyOf(ContextVariableReference<T> instance)
Creates an immutable copy of aContextVariableReferencevalue. 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 ContextVariableReference instance
-
builder
public static <T> ImmutableContextVariableReference.Builder<T> builder()
Creates a builder forImmutableContextVariableReference.ImmutableContextVariableReference.<T>builder() .valueType(io.dialob.rule.parser.api.ValueType) // requiredvalueType.itemId(io.dialob.executor.model.ItemId) // requireditemId.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableContextVariableReference builder
-
-