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 Details

    • create

      public static ModifiableVariable create(String name, String expression)
      Construct a modifiable instance of Variable.
      Parameters:
      name - The value for the name attribute (can be null)
      expression - The value for the expression attribute (can be null)
      Returns:
      A new modifiable instance
    • create

      public static ModifiableVariable create()
      Construct a modifiable instance of Variable.
      Returns:
      A new modifiable instance
    • getName

      public final String getName()
      Specified by:
      getName in interface Variable
      Returns:
      value of name attribute, may be null
    • getExpression

      public final String getExpression()
      Specified by:
      getExpression in interface Variable
      Returns:
      value of expression attribute, may be null
    • getDefaultValue

      public final Object getDefaultValue()
      Specified by:
      getDefaultValue in interface Variable
      Returns:
      value of defaultValue attribute, may be null
    • getContext

      public final Boolean getContext()
      Specified by:
      getContext in interface Variable
      Returns:
      true when this is context variable
    • getPublished

      public final Boolean getPublished()
      Specified by:
      getPublished in interface Variable
      Returns:
      true when context variable can be published and sent to client.
    • getContextType

      public final String getContextType()
      Specified by:
      getContextType in interface Variable
      Returns:
      value of contextType attribute, may be null
    • clear

      public ModifiableVariable clear()
      Clears the object by setting all attributes to their initial values.
      Returns:
      this for use in a chained invocation
    • from

      public ModifiableVariable from(Variable instance)
      Fill this modifiable instance with attribute values from the provided Variable instance. 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:
      this for use in a chained invocation
    • from

      public ModifiableVariable from(ModifiableVariable instance)
      Fill this modifiable instance with attribute values from the provided Variable instance. 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:
      this for use in a chained invocation
    • setName

      public ModifiableVariable setName(String name)
      Assigns a value to the name attribute.
      Parameters:
      name - The value for name, can be null
      Returns:
      this for use in a chained invocation
    • setExpression

      public ModifiableVariable setExpression(String expression)
      Assigns a value to the expression attribute.
      Parameters:
      expression - The value for expression, can be null
      Returns:
      this for use in a chained invocation
    • setDefaultValue

      public ModifiableVariable setDefaultValue(Object defaultValue)
      Assigns a value to the defaultValue attribute.
      Parameters:
      defaultValue - The value for defaultValue, can be null
      Returns:
      this for use in a chained invocation
    • setContext

      public ModifiableVariable setContext(Boolean context)
      Assigns a value to the context attribute.
      Parameters:
      context - The value for context, can be null
      Returns:
      this for use in a chained invocation
    • setPublished

      public ModifiableVariable setPublished(Boolean published)
      Assigns a value to the published attribute.
      Parameters:
      published - The value for published, can be null
      Returns:
      this for use in a chained invocation
    • setContextType

      public ModifiableVariable setContextType(String contextType)
      Assigns a value to the contextType attribute.
      Parameters:
      contextType - The value for contextType, can be null
      Returns:
      this for use in a chained invocation
    • isInitialized

      public final boolean isInitialized()
      Returns true if all required attributes are set, indicating that the object is initialized.
      Returns:
      true if set
    • toImmutable

      public final ImmutableVariable toImmutable()
      Converts to ImmutableVariable.
      Returns:
      An immutable instance of Variable
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ModifiableVariable that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: name, expression, defaultValue, context, published, contextType.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Generates a string representation of this Variable. If uninitialized, some attribute values may appear as question marks.
      Overrides:
      toString in class Object
      Returns:
      A string representation