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 theVariabletype.Use the
create()static factory methods to create new instances. Use thetoImmutable()method to convert to canonical immutable instances.ModifiableVariable is not thread-safe
- See Also:
ImmutableVariable, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifiableVariableclear()Clears the object by setting all attributes to their initial values.static ModifiableVariablecreate()Construct a modifiable instance ofVariable.static ModifiableVariablecreate(String name, String expression)Construct a modifiable instance ofVariable.booleanequals(Object another)This instance is equal to all instances ofModifiableVariablethat have equal attribute values.ModifiableVariablefrom(ModifiableVariable instance)Fill this modifiable instance with attribute values from the providedVariableinstance.ModifiableVariablefrom(Variable instance)Fill this modifiable instance with attribute values from the providedVariableinstance.BooleangetContext()StringgetContextType()ObjectgetDefaultValue()StringgetExpression()StringgetName()BooleangetPublished()inthashCode()Computes a hash code from attributes:name,expression,defaultValue,context,published,contextType.booleanisInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.ModifiableVariablesetContext(Boolean context)Assigns a value to thecontextattribute.ModifiableVariablesetContextType(String contextType)Assigns a value to thecontextTypeattribute.ModifiableVariablesetDefaultValue(Object defaultValue)Assigns a value to thedefaultValueattribute.ModifiableVariablesetExpression(String expression)Assigns a value to theexpressionattribute.ModifiableVariablesetName(String name)Assigns a value to thenameattribute.ModifiableVariablesetPublished(Boolean published)Assigns a value to thepublishedattribute.ImmutableVariabletoImmutable()Converts toImmutableVariable.StringtoString()Generates a string representation of thisVariable.
-
-
-
Method Detail
-
create
public static ModifiableVariable create(String name, String expression)
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
public static ModifiableVariable create()
Construct a modifiable instance ofVariable.- Returns:
- A new modifiable instance
-
getName
public final String getName()
-
getExpression
public final String getExpression()
- Specified by:
getExpressionin interfaceVariable- Returns:
- value of
expressionattribute, may benull
-
getDefaultValue
public final Object getDefaultValue()
- Specified by:
getDefaultValuein interfaceVariable- Returns:
- value of
defaultValueattribute, may benull
-
getContext
public final Boolean getContext()
- Specified by:
getContextin interfaceVariable- Returns:
- true when this is context variable
-
getPublished
public final Boolean getPublished()
- Specified by:
getPublishedin interfaceVariable- Returns:
- true when context variable can be published and sent to client.
-
getContextType
public final String getContextType()
- Specified by:
getContextTypein interfaceVariable- Returns:
- value of
contextTypeattribute, may benull
-
clear
public ModifiableVariable clear()
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
public ModifiableVariable from(Variable instance)
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
public ModifiableVariable from(ModifiableVariable instance)
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
public ModifiableVariable setName(String name)
Assigns a value to thenameattribute.- Parameters:
name- The value for name, can benull- Returns:
thisfor use in a chained invocation
-
setExpression
public ModifiableVariable setExpression(String expression)
Assigns a value to theexpressionattribute.- Parameters:
expression- The value for expression, can benull- Returns:
thisfor use in a chained invocation
-
setDefaultValue
public ModifiableVariable setDefaultValue(Object defaultValue)
Assigns a value to thedefaultValueattribute.- Parameters:
defaultValue- The value for defaultValue, can benull- Returns:
thisfor use in a chained invocation
-
setContext
public ModifiableVariable setContext(Boolean context)
Assigns a value to thecontextattribute.- Parameters:
context- The value for context, can benull- Returns:
thisfor use in a chained invocation
-
setPublished
public ModifiableVariable setPublished(Boolean published)
Assigns a value to thepublishedattribute.- Parameters:
published- The value for published, can benull- Returns:
thisfor use in a chained invocation
-
setContextType
public ModifiableVariable setContextType(String contextType)
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
public final ImmutableVariable toImmutable()
Converts toImmutableVariable.- Returns:
- An immutable instance of Variable
-
equals
public boolean equals(@Nullable Object another)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.
-
-