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 theVariableValuetype.Use the
create()static factory methods to create new instances. Use thetoImmutable()method to convert to canonical immutable instances.ModifiableVariableValue is not thread-safe
- See Also:
ImmutableVariableValue, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifiableVariableValueclear()Clears the object by setting all attributes to their initial values.static ModifiableVariableValuecreate()Construct a modifiable instance ofVariableValue.static ModifiableVariableValuecreate(String id, Object value)Construct a modifiable instance ofVariableValue.booleanequals(Object another)This instance is equal to all instances ofModifiableVariableValuethat have equal attribute values.ModifiableVariableValuefrom(ModifiableVariableValue instance)Fill this modifiable instance with attribute values from the providedVariableValueinstance.ModifiableVariableValuefrom(VariableValue instance)Fill this modifiable instance with attribute values from the providedVariableValueinstance.StringgetId()ObjectgetValue()inthashCode()Computes a hash code from attributes:id,value.booleanidIsSet()Returnstrueif the required attributeidis set.booleanisInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.ModifiableVariableValuesetId(String id)Assigns a value to theidattribute.ModifiableVariableValuesetValue(Object value)Assigns a value to thevalueattribute.ImmutableVariableValuetoImmutable()Converts toImmutableVariableValue.StringtoString()Generates a string representation of thisVariableValue.ModifiableVariableValueunsetId()Reset an attribute to its initial value.
-
-
-
Method Detail
-
create
public static ModifiableVariableValue create(String id, Object value)
Construct a modifiable instance ofVariableValue.
-
create
public static ModifiableVariableValue create()
Construct a modifiable instance ofVariableValue.- Returns:
- A new modifiable instance
-
getId
public final String getId()
- Specified by:
getIdin interfaceVariableValue- Returns:
- value of
idattribute
-
getValue
public final Object getValue()
- Specified by:
getValuein interfaceVariableValue- Returns:
- value of
valueattribute, may benull
-
clear
public ModifiableVariableValue clear()
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
public ModifiableVariableValue from(VariableValue instance)
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
public ModifiableVariableValue from(ModifiableVariableValue instance)
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
public ModifiableVariableValue setId(String id)
Assigns a value to theidattribute.- Parameters:
id- The value for id- Returns:
thisfor use in a chained invocation
-
setValue
public ModifiableVariableValue setValue(Object value)
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
public final ModifiableVariableValue 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
public final ImmutableVariableValue toImmutable()
Converts toImmutableVariableValue.- Returns:
- An immutable instance of VariableValue
-
equals
public boolean equals(@Nullable Object another)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.
-
-