Class ImmutableFormTag.Builder

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

@NotThreadSafe public static final class ImmutableFormTag.Builder extends Object
Builds instances of type ImmutableFormTag. 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 ImmutableFormTag.Builder from(FormTag instance)
      Fill a builder with attribute values from the provided FormTag 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
    • formName

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

      public final ImmutableFormTag.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
    • refName

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

      public final ImmutableFormTag.Builder created(Date created)
      Initializes the value for the created attribute.
      Parameters:
      created - The value for created (can be null)
      Returns:
      this builder for use in a chained invocation
    • formId

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

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

      public final ImmutableFormTag.Builder type(FormTag.Type type)
      Initializes the value for the type attribute.

      If not set, this attribute will have a default value as returned by the initializer of type.

      Parameters:
      type - The value for type
      Returns:
      this builder for use in a chained invocation
    • build

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