Class ImmutableFormItem.Builder

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

@NotThreadSafe public static final class ImmutableFormItem.Builder extends Object
Builds instances of type ImmutableFormItem. 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 ImmutableFormItem.Builder from(ModifiableFormItem instance)
      Fill a builder with attribute values from the provided ModifiableFormItem instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableFormItem.Builder from(FormItem instance)
      Fill a builder with attribute values from the provided FormItem instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • id

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

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

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

      public final ImmutableFormItem.Builder putLabel(@Nullable String key, @Nullable String value)
      Put one entry to the label map.
      Parameters:
      key - The key in the label map
      value - The associated value in the label map
      Returns:
      this builder for use in a chained invocation
    • putLabel

      public final ImmutableFormItem.Builder putLabel(Map.Entry<String,? extends String> entry)
      Put one entry to the label map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • label

      public final ImmutableFormItem.Builder label(Map<String,? extends String> entries)
      Sets or replaces all mappings from the specified map as entries for the label map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the label map
      Returns:
      this builder for use in a chained invocation
    • putAllLabel

      public final ImmutableFormItem.Builder putAllLabel(Map<String,? extends String> entries)
      Put all mappings from the specified map as entries to label map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the label map
      Returns:
      this builder for use in a chained invocation
    • putDescription

      public final ImmutableFormItem.Builder putDescription(@Nullable String key, @Nullable String value)
      Put one entry to the description map.
      Parameters:
      key - The key in the description map
      value - The associated value in the description map
      Returns:
      this builder for use in a chained invocation
    • putDescription

      public final ImmutableFormItem.Builder putDescription(Map.Entry<String,? extends String> entry)
      Put one entry to the description map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • description

      public final ImmutableFormItem.Builder description(Map<String,? extends String> entries)
      Sets or replaces all mappings from the specified map as entries for the description map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the description map
      Returns:
      this builder for use in a chained invocation
    • putAllDescription

      public final ImmutableFormItem.Builder putAllDescription(Map<String,? extends String> entries)
      Put all mappings from the specified map as entries to description map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the description map
      Returns:
      this builder for use in a chained invocation
    • required

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

      public final ImmutableFormItem.Builder putRequiredErrorText(@Nullable String key, @Nullable String value)
      Put one entry to the requiredErrorText map.
      Parameters:
      key - The key in the requiredErrorText map
      value - The associated value in the requiredErrorText map
      Returns:
      this builder for use in a chained invocation
    • putRequiredErrorText

      public final ImmutableFormItem.Builder putRequiredErrorText(Map.Entry<String,? extends String> entry)
      Put one entry to the requiredErrorText map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • requiredErrorText

      public final ImmutableFormItem.Builder requiredErrorText(Map<String,? extends String> entries)
      Sets or replaces all mappings from the specified map as entries for the requiredErrorText map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the requiredErrorText map
      Returns:
      this builder for use in a chained invocation
    • putAllRequiredErrorText

      public final ImmutableFormItem.Builder putAllRequiredErrorText(Map<String,? extends String> entries)
      Put all mappings from the specified map as entries to requiredErrorText map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the requiredErrorText map
      Returns:
      this builder for use in a chained invocation
    • readOnly

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

      public final ImmutableFormItem.Builder addItems(@Nullable String element)
      Adds one element to items list.
      Parameters:
      element - A items element
      Returns:
      this builder for use in a chained invocation
    • addItems

      public final ImmutableFormItem.Builder addItems(String... elements)
      Adds elements to items list.
      Parameters:
      elements - An array of items elements
      Returns:
      this builder for use in a chained invocation
    • items

      public final ImmutableFormItem.Builder items(Iterable<String> elements)
      Sets or replaces all elements for items list.
      Parameters:
      elements - An iterable of items elements
      Returns:
      this builder for use in a chained invocation
    • addAllItems

      public final ImmutableFormItem.Builder addAllItems(Iterable<String> elements)
      Adds elements to items list.
      Parameters:
      elements - An iterable of items elements
      Returns:
      this builder for use in a chained invocation
    • addClassName

      public final ImmutableFormItem.Builder addClassName(@Nullable String element)
      Adds one element to className list.
      Parameters:
      element - A className element
      Returns:
      this builder for use in a chained invocation
    • addClassName

      public final ImmutableFormItem.Builder addClassName(String... elements)
      Adds elements to className list.
      Parameters:
      elements - An array of className elements
      Returns:
      this builder for use in a chained invocation
    • className

      public final ImmutableFormItem.Builder className(Iterable<String> elements)
      Sets or replaces all elements for className list.
      Parameters:
      elements - An iterable of className elements
      Returns:
      this builder for use in a chained invocation
    • addAllClassName

      public final ImmutableFormItem.Builder addAllClassName(Iterable<String> elements)
      Adds elements to className list.
      Parameters:
      elements - An iterable of className elements
      Returns:
      this builder for use in a chained invocation
    • activeWhen

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

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

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

      public final ImmutableFormItem.Builder addValidations(@Nullable Validation element)
      Adds one element to validations list.
      Parameters:
      element - A validations element
      Returns:
      this builder for use in a chained invocation
    • addValidations

      public final ImmutableFormItem.Builder addValidations(Validation... elements)
      Adds elements to validations list.
      Parameters:
      elements - An array of validations elements
      Returns:
      this builder for use in a chained invocation
    • validations

      public final ImmutableFormItem.Builder validations(Iterable<? extends Validation> elements)
      Sets or replaces all elements for validations list.
      Parameters:
      elements - An iterable of validations elements
      Returns:
      this builder for use in a chained invocation
    • addAllValidations

      public final ImmutableFormItem.Builder addAllValidations(Iterable<? extends Validation> elements)
      Adds elements to validations list.
      Parameters:
      elements - An iterable of validations elements
      Returns:
      this builder for use in a chained invocation
    • valueSetId

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

      public final ImmutableFormItem.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
    • putProps

      public final ImmutableFormItem.Builder putProps(@Nullable String key, @Nullable Object value)
      Put one entry to the props map.
      Parameters:
      key - The key in the props map
      value - The associated value in the props map
      Returns:
      this builder for use in a chained invocation
    • putProps

      public final ImmutableFormItem.Builder putProps(Map.Entry<String,? extends Object> entry)
      Put one entry to the props map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • props

      public final ImmutableFormItem.Builder props(Map<String,? extends Object> entries)
      Sets or replaces all mappings from the specified map as entries for the props map. Nulls are not permitted as keys or values, but parameter itself can be null
      Parameters:
      entries - The entries that will be added to the props map
      Returns:
      this builder for use in a chained invocation
    • putAllProps

      public final ImmutableFormItem.Builder putAllProps(Map<String,? extends Object> entries)
      Put all mappings from the specified map as entries to props map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the props map
      Returns:
      this builder for use in a chained invocation
    • putAdditionalProperties

      public final ImmutableFormItem.Builder putAdditionalProperties(@Nullable String key, @Nullable Object value)
      Put one entry to the additionalProperties map.
      Parameters:
      key - The key in the additionalProperties map
      value - The associated value in the additionalProperties map
      Returns:
      this builder for use in a chained invocation
    • putAdditionalProperties

      public final ImmutableFormItem.Builder putAdditionalProperties(Map.Entry<String,? extends Object> entry)
      Put one entry to the additionalProperties map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • additionalProperties

      public final ImmutableFormItem.Builder additionalProperties(Map<String,? extends Object> entries)
      Sets or replaces all mappings from the specified map as entries for the additionalProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the additionalProperties map
      Returns:
      this builder for use in a chained invocation
    • putAllAdditionalProperties

      public final ImmutableFormItem.Builder putAllAdditionalProperties(Map<String,? extends Object> entries)
      Put all mappings from the specified map as entries to additionalProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the additionalProperties map
      Returns:
      this builder for use in a chained invocation
    • build

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