Package io.dialob.api.questionnaire
Class ModifiableContextValue
java.lang.Object
io.dialob.api.questionnaire.ModifiableContextValue
- All Implemented Interfaces:
ContextValue,Serializable
@ParametersAreNonnullByDefault
@Generated({"Modifiables.generator","ContextValue"})
@NotThreadSafe
public final class ModifiableContextValue
extends Object
implements ContextValue
A modifiable implementation of the
ContextValue type.
Use the create() static factory methods to create new instances.
Use the toImmutable() method to convert to canonical immutable instances.
ModifiableContextValue is not thread-safe
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclear()Clears the object by setting all attributes to their initial values.static ModifiableContextValuecreate()Construct a modifiable instance ofContextValue.static ModifiableContextValueConstruct a modifiable instance ofContextValue.booleanThis instance is equal to all instances ofModifiableContextValuethat have equal attribute values.from(ContextValue instance) Fill this modifiable instance with attribute values from the providedContextValueinstance.from(ModifiableContextValue instance) Fill this modifiable instance with attribute values from the providedContextValueinstance.final StringgetId()final ObjectgetValue()inthashCode()Computes a hash code from attributes:id,value.final booleanReturnstrueif all required attributes are set, indicating that the object is initialized.Assigns a value to theidattribute.Assigns a value to thevalueattribute.final ImmutableContextValueConverts toImmutableContextValue.toString()Generates a string representation of thisContextValue.
-
Method Details
-
create
Construct a modifiable instance ofContextValue. -
create
Construct a modifiable instance ofContextValue.- Returns:
- A new modifiable instance
-
getId
- Specified by:
getIdin interfaceContextValue- Returns:
- value of
idattribute, may benull
-
getValue
- Specified by:
getValuein interfaceContextValue- Returns:
- value of
valueattribute, may benull
-
clear
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedContextValueinstance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values).- Parameters:
instance- The instance from which to copy values- Returns:
thisfor use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedContextValueinstance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values).- Parameters:
instance- The instance from which to copy values- Returns:
thisfor use in a chained invocation
-
setId
Assigns a value to theidattribute.- Parameters:
id- The value for id, can benull- Returns:
thisfor use in a chained invocation
-
setValue
Assigns a value to thevalueattribute.- Parameters:
value- The value for value, can benull- Returns:
thisfor use in a chained invocation
-
isInitialized
public final boolean isInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.- Returns:
trueif set
-
toImmutable
Converts toImmutableContextValue.- Returns:
- An immutable instance of ContextValue
-
equals
This instance is equal to all instances ofModifiableContextValuethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,value. -
toString
Generates a string representation of thisContextValue. If uninitialized, some attribute values may appear as question marks.
-