Class ImmutableConstantValue<T>
java.lang.Object
io.dialob.session.engine.program.model.ImmutableConstantValue<T>
- All Implemented Interfaces:
ConstantValue<T>,ProgramNode,Value<T>,Serializable
@Generated(from="ConstantValue",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableConstantValue<T>
extends Object
implements ConstantValue<T>
Immutable implementation of
ConstantValue.
Use the builder to create immutable instances:
ImmutableConstantValue.builder().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableConstantValue. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ImmutableConstantValue.Builder<T> builder()Creates a builder forImmutableConstantValue.static <T> ImmutableConstantValue<T> copyOf(ConstantValue<T> instance) Creates an immutable copy of aConstantValuevalue.booleanThis instance is equal to all instances ofImmutableConstantValuethat have equal attribute values.getValue()inthashCode()Computes a hash code from attributes:value,valueType.toString()Prints the immutable valueConstantValuewith attribute values.final ImmutableConstantValue<T> Copy the current immutable object by setting a value for thevalueattribute.final ImmutableConstantValue<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.ConstantValue
eval
-
Method Details
-
getValue
- Specified by:
getValuein interfaceConstantValue<T>- Returns:
- The value of the
valueattribute
-
getValueType
- Specified by:
getValueTypein interfaceConstantValue<T>- Specified by:
getValueTypein interfaceValue<T>- 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 (can benull)- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableConstantValuethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:value,valueType. -
toString
Prints the immutable valueConstantValuewith attribute values. -
copyOf
Creates an immutable copy of aConstantValuevalue. 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 ConstantValue instance
-
builder
Creates a builder forImmutableConstantValue.ImmutableConstantValue.<T>builder() .value(T) // requiredvalue.valueType(io.dialob.rule.parser.api.ValueType | null) // nullablevalueType.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableConstantValue builder
-