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 theContextValuetype.Use the
create()static factory methods to create new instances. Use thetoImmutable()method to convert to canonical immutable instances.ModifiableContextValue is not thread-safe
- See Also:
ImmutableContextValue, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifiableContextValueclear()Clears the object by setting all attributes to their initial values.static ModifiableContextValuecreate()Construct a modifiable instance ofContextValue.static ModifiableContextValuecreate(String id, Object value)Construct a modifiable instance ofContextValue.booleanequals(Object another)This instance is equal to all instances ofModifiableContextValuethat have equal attribute values.ModifiableContextValuefrom(ContextValue instance)Fill this modifiable instance with attribute values from the providedContextValueinstance.ModifiableContextValuefrom(ModifiableContextValue instance)Fill this modifiable instance with attribute values from the providedContextValueinstance.StringgetId()ObjectgetValue()inthashCode()Computes a hash code from attributes:id,value.booleanisInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.ModifiableContextValuesetId(String id)Assigns a value to theidattribute.ModifiableContextValuesetValue(Object value)Assigns a value to thevalueattribute.ImmutableContextValuetoImmutable()Converts toImmutableContextValue.StringtoString()Generates a string representation of thisContextValue.
-
-
-
Method Detail
-
create
public static ModifiableContextValue create(String id, Object value)
Construct a modifiable instance ofContextValue.
-
create
public static ModifiableContextValue create()
Construct a modifiable instance ofContextValue.- Returns:
- A new modifiable instance
-
getId
public final String getId()
- Specified by:
getIdin interfaceContextValue- Returns:
- value of
idattribute, may benull
-
getValue
public final Object getValue()
- Specified by:
getValuein interfaceContextValue- Returns:
- value of
valueattribute, may benull
-
clear
public ModifiableContextValue clear()
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
public ModifiableContextValue from(ContextValue instance)
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
public ModifiableContextValue from(ModifiableContextValue instance)
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
public ModifiableContextValue setId(String id)
Assigns a value to theidattribute.- Parameters:
id- The value for id, can benull- Returns:
thisfor use in a chained invocation
-
setValue
public ModifiableContextValue setValue(Object value)
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
public final ImmutableContextValue toImmutable()
Converts toImmutableContextValue.- Returns:
- An immutable instance of ContextValue
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofModifiableContextValuethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,value.
-
-