Package io.dialob.api.questionnaire
Class ImmutableContextValue
java.lang.Object
io.dialob.api.questionnaire.ImmutableContextValue
- All Implemented Interfaces:
ContextValue,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableContextValue
extends Object
implements ContextValue
Immutable implementation of
ContextValue.
Use the builder to create immutable instances:
ImmutableContextValue.builder().
Use the static factory method to create immutable instances:
ImmutableContextValue.of().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableContextValue. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableContextValue.static ImmutableContextValuecopyOf(ContextValue instance) Creates an immutable copy of aContextValuevalue.booleanThis instance is equal to all instances ofImmutableContextValuethat have equal attribute values.getId()getValue()inthashCode()Computes a hash code from attributes:id,value.static ImmutableContextValueConstruct a new immutableContextValueinstance.toString()Prints the immutable valueContextValuewith attribute values.final ImmutableContextValueCopy the current immutable object by setting a value for theidattribute.final ImmutableContextValueCopy the current immutable object by setting a value for thevalueattribute.
-
Method Details
-
getId
- Specified by:
getIdin interfaceContextValue- Returns:
- The value of the
idattribute
-
getValue
- Specified by:
getValuein interfaceContextValue- Returns:
- The value of the
valueattribute
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id (can benull)- Returns:
- A modified copy of 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 of the
thisobject
-
equals
This instance is equal to all instances ofImmutableContextValuethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,value. -
toString
Prints the immutable valueContextValuewith attribute values. -
of
Construct a new immutableContextValueinstance.- Parameters:
id- The value for theidattributevalue- The value for thevalueattribute- Returns:
- An immutable ContextValue instance
-
copyOf
Creates an immutable copy of aContextValuevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ContextValue instance
-
builder
Creates a builder forImmutableContextValue.ImmutableContextValue.builder() .id(String | null) // nullableid.value(Object | null) // nullablevalue.build();- Returns:
- A new ImmutableContextValue builder
-