Package io.dialob.api.questionnaire
Class ModifiableVariableValue
java.lang.Object
io.dialob.api.questionnaire.ModifiableVariableValue
- All Implemented Interfaces:
VariableValue,Serializable
@ParametersAreNonnullByDefault
@Generated({"Modifiables.generator","VariableValue"})
@NotThreadSafe
public final class ModifiableVariableValue
extends Object
implements VariableValue
A modifiable implementation of the
VariableValue type.
Use the create() static factory methods to create new instances.
Use the toImmutable() method to convert to canonical immutable instances.
ModifiableVariableValue is not thread-safe
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclear()Clears the object by setting all attributes to their initial values.static ModifiableVariableValuecreate()Construct a modifiable instance ofVariableValue.static ModifiableVariableValueConstruct a modifiable instance ofVariableValue.booleanThis instance is equal to all instances ofModifiableVariableValuethat have equal attribute values.from(ModifiableVariableValue instance) Fill this modifiable instance with attribute values from the providedVariableValueinstance.from(VariableValue instance) Fill this modifiable instance with attribute values from the providedVariableValueinstance.final StringgetId()final ObjectgetValue()inthashCode()Computes a hash code from attributes:id,value.final booleanidIsSet()Returnstrueif the required attributeidis set.final booleanReturnstrueif all required attributes are set, indicating that the object is initialized.Assigns a value to theidattribute.Assigns a value to thevalueattribute.final ImmutableVariableValueConverts toImmutableVariableValue.toString()Generates a string representation of thisVariableValue.final ModifiableVariableValueunsetId()Reset an attribute to its initial value.
-
Method Details
-
create
Construct a modifiable instance ofVariableValue. -
create
Construct a modifiable instance ofVariableValue.- Returns:
- A new modifiable instance
-
getId
- Specified by:
getIdin interfaceVariableValue- Returns:
- value of
idattribute
-
getValue
- Specified by:
getValuein interfaceVariableValue- 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 providedVariableValueinstance. 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 providedVariableValueinstance. 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- 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
-
idIsSet
public final boolean idIsSet()Returnstrueif the required attributeidis set.- Returns:
trueif set
-
unsetId
Reset an attribute to its initial value.- 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 toImmutableVariableValue.- Returns:
- An immutable instance of VariableValue
-
equals
This instance is equal to all instances ofModifiableVariableValuethat have equal attribute values. An uninitialized instance is equal only to itself. -
hashCode
public int hashCode()Computes a hash code from attributes:id,value. -
toString
Generates a string representation of thisVariableValue. If uninitialized, some attribute values may appear as question marks.
-