Class ImmutableError

    • Method Detail

      • isPrototype

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

        @Nullable
        public String getCode()
        Specified by:
        getCode in interface Error
        Returns:
        The value of the code attribute
      • getItemId

        public ItemId getItemId()
        Specified by:
        getItemId in interface Error
        Returns:
        The value of the itemId attribute
      • getLabel

        @Nullable
        public Expression getLabel()
        Specified by:
        getLabel in interface Error
        Returns:
        The value of the label attribute
      • withIsPrototype

        public final ImmutableError 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
      • withCode

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

        public final ImmutableError withItemId​(ItemId value)
        Copy the current immutable object by setting a value for the itemId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for itemId
        Returns:
        A modified copy of the this object
      • withValidationExpression

        public final ImmutableError withValidationExpression​(Expression value)
        Copy the current immutable object by setting a value for the validationExpression attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for validationExpression
        Returns:
        A modified copy of the this object
      • withDisabledExpression

        public final ImmutableError 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 ImmutableError 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
      • withLabel

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

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableError 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, code, itemId, validationExpression, disabledExpression, label.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableError copyOf​(Error instance)
        Creates an immutable copy of a Error 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 Error instance
      • builder

        public static ImmutableError.Builder builder()
        Creates a builder for ImmutableError.
         ImmutableError.builder()
            .isPrototype(boolean) // optional isPrototype
            .code(String | null) // nullable code
            .itemId(io.dialob.executor.model.ItemId) // required itemId
            .validationExpression(io.dialob.program.model.Expression) // required validationExpression
            .disabledExpression(io.dialob.program.model.Expression) // optional disabledExpression
            .label(io.dialob.program.model.Expression | null) // nullable label
            .build();
         
        Returns:
        A new ImmutableError builder