Class ImmutableConditionalValue<T>
java.lang.Object
io.dialob.session.engine.program.model.ImmutableConditionalValue<T>
- All Implemented Interfaces:
ConditionalValue<T>,ProgramNode,Value<T>,Serializable
@Generated(from="ConditionalValue",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableConditionalValue<T>
extends Object
implements ConditionalValue<T>
Immutable implementation of
ConditionalValue.
Use the builder to create immutable instances:
ImmutableConditionalValue.builder().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableConditionalValue. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ImmutableConditionalValue.Builder<T> builder()Creates a builder forImmutableConditionalValue.static <T> ImmutableConditionalValue<T> copyOf(ConditionalValue<T> instance) Creates an immutable copy of aConditionalValuevalue.booleanThis instance is equal to all instances ofImmutableConditionalValuethat have equal attribute values.getValue()getWhen()inthashCode()Computes a hash code from attributes:when,value,fallbackValue,valueType.toString()Prints the immutable valueConditionalValuewith attribute values.final ImmutableConditionalValue<T> withFallbackValue(T value) Copy the current immutable object by setting a value for thefallbackValueattribute.final ImmutableConditionalValue<T> Copy the current immutable object by setting a value for thevalueattribute.final ImmutableConditionalValue<T> withValueType(ValueType value) Copy the current immutable object by setting a value for thevalueTypeattribute.final ImmutableConditionalValue<T> withWhen(Expression value) Copy the current immutable object by setting a value for thewhenattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.dialob.session.engine.program.model.ConditionalValue
eval
-
Method Details
-
getWhen
- Specified by:
getWhenin interfaceConditionalValue<T>- Returns:
- The value of the
whenattribute
-
getValue
- Specified by:
getValuein interfaceConditionalValue<T>- Returns:
- The value of the
valueattribute
-
getFallbackValue
- Specified by:
getFallbackValuein interfaceConditionalValue<T>- Returns:
- The value of the
fallbackValueattribute
-
getValueType
- Specified by:
getValueTypein interfaceConditionalValue<T>- Specified by:
getValueTypein interfaceValue<T>- Returns:
- The value of the
valueTypeattribute
-
withWhen
Copy the current immutable object by setting a value for thewhenattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for when- Returns:
- A modified copy or the
thisobject
-
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 (can benull)- Returns:
- A modified copy or the
thisobject
-
withFallbackValue
Copy the current immutable object by setting a value for thefallbackValueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for fallbackValue (can benull)- 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 ofImmutableConditionalValuethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:when,value,fallbackValue,valueType. -
toString
Prints the immutable valueConditionalValuewith attribute values. -
copyOf
Creates an immutable copy of aConditionalValuevalue. 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 ConditionalValue instance
-
builder
Creates a builder forImmutableConditionalValue.ImmutableConditionalValue.<T>builder() .when(io.dialob.session.engine.program.model.Expression) // requiredwhen.value(T | null) // nullablevalue.fallbackValue(T | null) // nullablefallbackValue.valueType(io.dialob.rule.parser.api.ValueType) // requiredvalueType.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableConditionalValue builder
-