Class ImmutableVariable.Builder

java.lang.Object
io.dialob.api.form.ImmutableVariable.Builder
Enclosing class:
ImmutableVariable

@NotThreadSafe public static final class ImmutableVariable.Builder extends Object
Builds instances of type ImmutableVariable. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      public final ImmutableVariable.Builder from(ModifiableVariable instance)
      Fill a builder with attribute values from the provided ModifiableVariable instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableVariable.Builder from(Variable instance)
      Fill a builder with attribute values from the provided Variable instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • name

      public final ImmutableVariable.Builder name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name (can be null)
      Returns:
      this builder for use in a chained invocation
    • expression

      public final ImmutableVariable.Builder expression(String expression)
      Initializes the value for the expression attribute.
      Parameters:
      expression - The value for expression (can be null)
      Returns:
      this builder for use in a chained invocation
    • defaultValue

      public final ImmutableVariable.Builder defaultValue(Object defaultValue)
      Initializes the value for the defaultValue attribute.
      Parameters:
      defaultValue - The value for defaultValue (can be null)
      Returns:
      this builder for use in a chained invocation
    • context

      public final ImmutableVariable.Builder context(Boolean context)
      Initializes the value for the context attribute.
      Parameters:
      context - The value for context (can be null)
      Returns:
      this builder for use in a chained invocation
    • published

      public final ImmutableVariable.Builder published(Boolean published)
      Initializes the value for the published attribute.
      Parameters:
      published - The value for published (can be null)
      Returns:
      this builder for use in a chained invocation
    • contextType

      public final ImmutableVariable.Builder contextType(String contextType)
      Initializes the value for the contextType attribute.
      Parameters:
      contextType - The value for contextType (can be null)
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableVariable build()
      Builds a new ImmutableVariable.
      Returns:
      An immutable instance of Variable
      Throws:
      IllegalStateException - if any required attributes are missing