Class ImmutableError

java.lang.Object
io.dialob.session.engine.program.model.ImmutableError
All Implemented Interfaces:
Error, ProgramNode, StructuralNode, Serializable

@Generated(from="Error", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableError extends Object implements Error
Immutable implementation of Error.

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

See Also:
  • Method Details

    • 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
    • getValidationExpression

      public Expression getValidationExpression()
      Specified by:
      getValidationExpression in interface Error
      Returns:
      The value of the validationExpression attribute
    • getDisabledExpression

      public Optional<Expression> getDisabledExpression()
      Specified by:
      getDisabledExpression in interface Error
      Returns:
      The value of the disabledExpression 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 or 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 or 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 or 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 or 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 or this if not changed
    • 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 - An optional value for disabledExpression
      Returns:
      A modified copy or this if not changed
    • 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 or 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.session.engine.session.model.ItemId) // required itemId
          .validationExpression(io.dialob.session.engine.program.model.Expression) // required validationExpression
          .disabledExpression(Optional<io.dialob.session.engine.program.model.Expression>) // optional disabledExpression
          .label(io.dialob.session.engine.program.model.Expression | null) // nullable label
          .build();
       
      Returns:
      A new ImmutableError builder