Class ImmutableFormItem

    • Method Detail

      • isPrototype

        public boolean isPrototype()
        Specified by:
        isPrototype in interface StructuralNode
        Returns:
        The value of the isPrototype attribute
      • getId

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

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

        @Nullable
        public ValueType getValueType()
        Specified by:
        getValueType in interface Item
        Returns:
        The value of the valueType attribute
      • getView

        @Nullable
        public @Nullable String getView()
        Specified by:
        getView in interface DisplayItem
        Returns:
        The value of the view attribute
      • withIsPrototype

        public final ImmutableFormItem withIsPrototype​(boolean value)
        Copy the current immutable object by setting a value for the isPrototype attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for isPrototype
        Returns:
        A modified copy of the this object
      • withId

        public final ImmutableFormItem withId​(ItemId value)
        Copy the current immutable object by setting a value for the id attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id
        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
        Returns:
        A modified copy of the this object
      • withValueType

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

        public final ImmutableFormItem withValueSetId​(String value)
        Copy the current immutable object by setting a present value for the optional valueSetId attribute.
        Parameters:
        value - The value for valueSetId
        Returns:
        A modified copy of this object
      • withValueSetId

        public final ImmutableFormItem withValueSetId​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the valueSetId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for valueSetId
        Returns:
        A modified copy of this object
      • withDefaultValue

        public final ImmutableFormItem withDefaultValue​(Object value)
        Copy the current immutable object by setting a present value for the optional defaultValue attribute.
        Parameters:
        value - The value for defaultValue
        Returns:
        A modified copy of this object
      • withDefaultValue

        public final ImmutableFormItem withDefaultValue​(Optional<? extends Object> optional)
        Copy the current immutable object by setting an optional value for the defaultValue attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for defaultValue
        Returns:
        A modified copy of this object
      • withView

        public final ImmutableFormItem withView​(@Nullable
                                                @Nullable 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
      • withProps

        public final ImmutableFormItem withProps​(@Nullable
                                                 @Nullable 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
      • withClassName

        public final ImmutableFormItem withClassName​(Expression value)
        Copy the current immutable object by setting a present value for the optional className attribute.
        Parameters:
        value - The value for className
        Returns:
        A modified copy of this object
      • withClassName

        public final ImmutableFormItem withClassName​(Optional<? extends Expression> optional)
        Copy the current immutable object by setting an optional value for the className attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for className
        Returns:
        A modified copy of this object
      • withActiveExpression

        public final ImmutableFormItem withActiveExpression​(Expression value)
        Copy the current immutable object by setting a present value for the optional activeExpression attribute.
        Parameters:
        value - The value for activeExpression
        Returns:
        A modified copy of this object
      • withActiveExpression

        public final ImmutableFormItem withActiveExpression​(Optional<? extends Expression> optional)
        Copy the current immutable object by setting an optional value for the activeExpression attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for activeExpression
        Returns:
        A modified copy of this object
      • withRequiredExpression

        public final ImmutableFormItem withRequiredExpression​(Expression value)
        Copy the current immutable object by setting a present value for the optional requiredExpression attribute.
        Parameters:
        value - The value for requiredExpression
        Returns:
        A modified copy of this object
      • withRequiredExpression

        public final ImmutableFormItem withRequiredExpression​(Optional<? extends Expression> optional)
        Copy the current immutable object by setting an optional value for the requiredExpression attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for requiredExpression
        Returns:
        A modified copy of this object
      • withDisabledExpression

        public final ImmutableFormItem withDisabledExpression​(Expression value)
        Copy the current immutable object by setting a present value for the optional disabledExpression attribute.
        Parameters:
        value - The value for disabledExpression
        Returns:
        A modified copy of this object
      • withDisabledExpression

        public final ImmutableFormItem withDisabledExpression​(Optional<? extends Expression> optional)
        Copy the current immutable object by setting an optional value for the disabledExpression attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for disabledExpression
        Returns:
        A modified copy of this object
      • withLabelExpression

        public final ImmutableFormItem withLabelExpression​(Expression value)
        Copy the current immutable object by setting a present value for the optional labelExpression attribute.
        Parameters:
        value - The value for labelExpression
        Returns:
        A modified copy of this object
      • withLabelExpression

        public final ImmutableFormItem withLabelExpression​(Optional<? extends Expression> optional)
        Copy the current immutable object by setting an optional value for the labelExpression attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for labelExpression
        Returns:
        A modified copy of this object
      • withDescriptionExpression

        public final ImmutableFormItem withDescriptionExpression​(Expression value)
        Copy the current immutable object by setting a present value for the optional descriptionExpression attribute.
        Parameters:
        value - The value for descriptionExpression
        Returns:
        A modified copy of this object
      • withDescriptionExpression

        public final ImmutableFormItem withDescriptionExpression​(Optional<? extends Expression> optional)
        Copy the current immutable object by setting an optional value for the descriptionExpression attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for descriptionExpression
        Returns:
        A modified copy of this object
      • withErrors

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

        public final ImmutableFormItem withErrors​(Iterable<? extends Error> elements)
        Copy the current immutable object with elements that replace the content of errors. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of errors elements to set
        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: isPrototype, id, type, valueType, valueSetId, defaultValue, view, props, className, activeExpression, requiredExpression, disabledExpression, labelExpression, descriptionExpression, errors.
        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()
            .isPrototype(boolean) // optional isPrototype
            .id(io.dialob.executor.model.ItemId) // required id
            .type(String) // required type
            .valueType(io.dialob.rule.parser.api.ValueType | null) // nullable valueType
            .valueSetId(String) // optional valueSetId
            .defaultValue(Object) // optional defaultValue
            .view(String | null) // nullable view
            .props(Map&lt;String, Object&gt; | null) // nullable props
            .className(io.dialob.program.model.Expression) // optional className
            .activeExpression(io.dialob.program.model.Expression) // optional activeExpression
            .requiredExpression(io.dialob.program.model.Expression) // optional requiredExpression
            .disabledExpression(io.dialob.program.model.Expression) // optional disabledExpression
            .labelExpression(io.dialob.program.model.Expression) // optional labelExpression
            .descriptionExpression(io.dialob.program.model.Expression) // optional descriptionExpression
            .addErrors|addAllErrors(io.dialob.program.model.Error) // errors elements
            .build();
         
        Returns:
        A new ImmutableFormItem builder