Package io.dialob.api.form
Class ModifiableVariable
java.lang.Object
io.dialob.api.form.ModifiableVariable
- All Implemented Interfaces:
Variable,Serializable
@ParametersAreNonnullByDefault
@Generated({"Modifiables.generator","Variable"})
@NotThreadSafe
public final class ModifiableVariable
extends Object
implements Variable
A modifiable implementation of the
Variable type.
Use the create() static factory methods to create new instances.
Use the toImmutable() method to convert to canonical immutable instances.
ModifiableVariable is not thread-safe
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclear()Clears the object by setting all attributes to their initial values.static ModifiableVariablecreate()Construct a modifiable instance ofVariable.static ModifiableVariableConstruct a modifiable instance ofVariable.booleanThis instance is equal to all instances ofModifiableVariablethat have equal attribute values.from(ModifiableVariable instance) Fill this modifiable instance with attribute values from the providedVariableinstance.Fill this modifiable instance with attribute values from the providedVariableinstance.final Booleanfinal Stringfinal Objectfinal Stringfinal StringgetName()final BooleaninthashCode()Computes a hash code from attributes:name,expression,defaultValue,context,published,contextType.final booleanReturnstrueif all required attributes are set, indicating that the object is initialized.setContext(Boolean context) Assigns a value to thecontextattribute.setContextType(String contextType) Assigns a value to thecontextTypeattribute.setDefaultValue(Object defaultValue) Assigns a value to thedefaultValueattribute.setExpression(String expression) Assigns a value to theexpressionattribute.Assigns a value to thenameattribute.setPublished(Boolean published) Assigns a value to thepublishedattribute.final ImmutableVariableConverts toImmutableVariable.toString()Generates a string representation of thisVariable.
-
Method Details
-
create
Construct a modifiable instance ofVariable.- Parameters:
name- The value for thenameattribute (can benull)expression- The value for theexpressionattribute (can benull)- Returns:
- A new modifiable instance
-
create
Construct a modifiable instance ofVariable.- Returns:
- A new modifiable instance
-
getName
-
getExpression
- Specified by:
getExpressionin interfaceVariable- Returns:
- value of
expressionattribute, may benull
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceVariable- Returns:
- value of
defaultValueattribute, may benull
-
getContext
- Specified by:
getContextin interfaceVariable- Returns:
- true when this is context variable
-
getPublished
- Specified by:
getPublishedin interfaceVariable- Returns:
- true when context variable can be published and sent to client.
-
getContextType
- Specified by:
getContextTypein interfaceVariable- Returns:
- value of
contextTypeattribute, 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 providedVariableinstance. 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 providedVariableinstance. 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
-
setName
Assigns a value to thenameattribute.- Parameters:
name- The value for name, can benull- Returns:
thisfor use in a chained invocation
-
setExpression
Assigns a value to theexpressionattribute.- Parameters:
expression- The value for expression, can benull- Returns:
thisfor use in a chained invocation
-
setDefaultValue
Assigns a value to thedefaultValueattribute.- Parameters:
defaultValue- The value for defaultValue, can benull- Returns:
thisfor use in a chained invocation
-
setContext
Assigns a value to thecontextattribute.- Parameters:
context- The value for context, can benull- Returns:
thisfor use in a chained invocation
-
setPublished
Assigns a value to thepublishedattribute.- Parameters:
published- The value for published, can benull- Returns:
thisfor use in a chained invocation
-
setContextType
Assigns a value to thecontextTypeattribute.- Parameters:
contextType- The value for contextType, 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 toImmutableVariable.- Returns:
- An immutable instance of Variable
-
equals
This instance is equal to all instances ofModifiableVariablethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,expression,defaultValue,context,published,contextType. -
toString
Generates a string representation of thisVariable. If uninitialized, some attribute values may appear as question marks.
-