Class ImmutableFormItem

  • All Implemented Interfaces:
    FormItem, Serializable

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableFormItem
    extends Object
    implements FormItem
    Immutable implementation of FormItem.

    Use the builder to create immutable instances: ImmutableFormItem.builder().

    See Also:
    Serialized Form
    • Method Detail

      • getId

        public String getId()
        Specified by:
        getId in interface FormItem
        Returns:
        The value of the id attribute
      • getType

        public String getType()
        Specified by:
        getType in interface FormItem
        Returns:
        The value of the type attribute
      • getView

        public String getView()
        Specified by:
        getView in interface FormItem
        Returns:
        The value of the view attribute
      • getRequired

        public String getRequired()
        Specified by:
        getRequired in interface FormItem
        Returns:
        The value of the required attribute
      • getReadOnly

        public Boolean getReadOnly()
        Specified by:
        getReadOnly in interface FormItem
        Returns:
        The value of the readOnly attribute
      • getItems

        public List<String> getItems()
        Specified by:
        getItems in interface FormItem
        Returns:
        The value of the items attribute
      • getActiveWhen

        public String getActiveWhen()
        Specified by:
        getActiveWhen in interface FormItem
        Returns:
        The value of the activeWhen attribute
      • getCanAddRowWhen

        public String getCanAddRowWhen()
        Specified by:
        getCanAddRowWhen in interface FormItem
        Returns:
        The value of the canAddRowWhen attribute
      • getCanRemoveRowWhen

        public String getCanRemoveRowWhen()
        Specified by:
        getCanRemoveRowWhen in interface FormItem
        Returns:
        The value of the canRemoveRowWhen attribute
      • getValueSetId

        public String getValueSetId()
        Specified by:
        getValueSetId in interface FormItem
        Returns:
        The value of the valueSetId attribute
      • getDefaultValue

        public Object getDefaultValue()
        Specified by:
        getDefaultValue in interface FormItem
        Returns:
        The value of the defaultValue attribute
      • withId

        public final ImmutableFormItem withId​(String value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id (can be null)
        Returns:
        A modified copy of the this object
      • withType

        public final ImmutableFormItem withType​(String value)
        Copy the current immutable object by setting a value for the type attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for type (can be null)
        Returns:
        A modified copy of the this object
      • withView

        public final ImmutableFormItem withView​(String value)
        Copy the current immutable object by setting a value for the view attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for view (can be null)
        Returns:
        A modified copy of the this object
      • withLabel

        public final ImmutableFormItem withLabel​(Map<String,​? extends String> entries)
        Copy the current immutable object by replacing the label map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the label map
        Returns:
        A modified copy of this object
      • withDescription

        public final ImmutableFormItem withDescription​(Map<String,​? extends String> entries)
        Copy the current immutable object by replacing the description map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the description map
        Returns:
        A modified copy of this object
      • withRequired

        public final ImmutableFormItem withRequired​(String value)
        Copy the current immutable object by setting a value for the required attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for required (can be null)
        Returns:
        A modified copy of the this object
      • withRequiredErrorText

        public final ImmutableFormItem withRequiredErrorText​(Map<String,​? extends String> entries)
        Copy the current immutable object by replacing the requiredErrorText map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the requiredErrorText map
        Returns:
        A modified copy of this object
      • withReadOnly

        public final ImmutableFormItem withReadOnly​(Boolean value)
        Copy the current immutable object by setting a value for the readOnly attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for readOnly (can be null)
        Returns:
        A modified copy of the this object
      • withItems

        public final ImmutableFormItem withItems​(String... elements)
        Copy the current immutable object with elements that replace the content of items.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withItems

        public final ImmutableFormItem withItems​(Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of items. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of items elements to set
        Returns:
        A modified copy of this object
      • withClassName

        public final ImmutableFormItem withClassName​(String... elements)
        Copy the current immutable object with elements that replace the content of className.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withClassName

        public final ImmutableFormItem withClassName​(Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of className. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of className elements to set
        Returns:
        A modified copy of this object
      • withActiveWhen

        public final ImmutableFormItem withActiveWhen​(String value)
        Copy the current immutable object by setting a value for the activeWhen attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for activeWhen (can be null)
        Returns:
        A modified copy of the this object
      • withCanAddRowWhen

        public final ImmutableFormItem withCanAddRowWhen​(String value)
        Copy the current immutable object by setting a value for the canAddRowWhen attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for canAddRowWhen (can be null)
        Returns:
        A modified copy of the this object
      • withCanRemoveRowWhen

        public final ImmutableFormItem withCanRemoveRowWhen​(String value)
        Copy the current immutable object by setting a value for the canRemoveRowWhen attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for canRemoveRowWhen (can be null)
        Returns:
        A modified copy of the this object
      • withValidations

        public final ImmutableFormItem withValidations​(Validation... elements)
        Copy the current immutable object with elements that replace the content of validations.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withValidations

        public final ImmutableFormItem withValidations​(Iterable<? extends Validation> elements)
        Copy the current immutable object with elements that replace the content of validations. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of validations elements to set
        Returns:
        A modified copy of this object
      • withValueSetId

        public final ImmutableFormItem withValueSetId​(String value)
        Copy the current immutable object by setting a value for the valueSetId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for valueSetId (can be null)
        Returns:
        A modified copy of the this object
      • withDefaultValue

        public final ImmutableFormItem withDefaultValue​(Object value)
        Copy the current immutable object by setting a value for the defaultValue attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for defaultValue (can be null)
        Returns:
        A modified copy of the this object
      • withProps

        public final ImmutableFormItem withProps​(Map<String,​? extends Object> entries)
        Copy the current immutable object by replacing the props map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the props map
        Returns:
        A modified copy of this object
      • withAdditionalProperties

        public final ImmutableFormItem withAdditionalProperties​(Map<String,​? extends Object> entries)
        Copy the current immutable object by replacing the additionalProperties map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the additionalProperties map
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableFormItem 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: id, type, view, label, description, required, requiredErrorText, readOnly, items, className, activeWhen, canAddRowWhen, canRemoveRowWhen, validations, valueSetId, defaultValue, props, additionalProperties.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value FormItem with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableFormItem copyOf​(FormItem instance)
        Creates an immutable copy of a FormItem value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable FormItem instance
      • builder

        public static ImmutableFormItem.Builder builder()
        Creates a builder for ImmutableFormItem.
         ImmutableFormItem.builder()
            .id(String | null) // nullable id
            .type(String | null) // nullable type
            .view(String | null) // nullable view
            .putLabel|putAllLabel(String => String) // label mappings
            .putDescription|putAllDescription(String => String) // description mappings
            .required(String | null) // nullable required
            .putRequiredErrorText|putAllRequiredErrorText(String => String) // requiredErrorText mappings
            .readOnly(Boolean | null) // nullable readOnly
            .addItems|addAllItems(String) // items elements
            .addClassName|addAllClassName(String) // className elements
            .activeWhen(String | null) // nullable activeWhen
            .canAddRowWhen(String | null) // nullable canAddRowWhen
            .canRemoveRowWhen(String | null) // nullable canRemoveRowWhen
            .addValidations|addAllValidations(io.dialob.api.form.Validation) // validations elements
            .valueSetId(String | null) // nullable valueSetId
            .defaultValue(Object | null) // nullable defaultValue
            .props(Map&lt;String, Object&gt; | null) // nullable props
            .putAdditionalProperties|putAllAdditionalProperties(String => Object) // additionalProperties mappings
            .build();
         
        Returns:
        A new ImmutableFormItem builder