Class ImmutableFormValidationError

java.lang.Object
io.dialob.api.form.ImmutableFormValidationError
All Implemented Interfaces:
FormValidationError, Serializable

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

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

See Also:
  • Method Details

    • getItemId

      public String getItemId()
      Specified by:
      getItemId in interface FormValidationError
      Returns:
      The value of the itemId attribute
    • getMessage

      public String getMessage()
      Specified by:
      getMessage in interface FormValidationError
      Returns:
      The value of the message attribute
    • getLevel

      public FormValidationError.Level getLevel()
      Specified by:
      getLevel in interface FormValidationError
      Returns:
      The value of the level attribute
    • getType

      public FormValidationError.Type getType()
      Specified by:
      getType in interface FormValidationError
      Returns:
      The value of the type attribute
    • getExpression

      public Optional<String> getExpression()
      Specified by:
      getExpression in interface FormValidationError
      Returns:
      The value of the expression attribute
    • getStartIndex

      public Optional<Integer> getStartIndex()
      Specified by:
      getStartIndex in interface FormValidationError
      Returns:
      The value of the startIndex attribute
    • getEndIndex

      public Optional<Integer> getEndIndex()
      Specified by:
      getEndIndex in interface FormValidationError
      Returns:
      The value of the endIndex attribute
    • getIndex

      public Optional<Integer> getIndex()
      Specified by:
      getIndex in interface FormValidationError
      Returns:
      The value of the index attribute
    • withItemId

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

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

      Copy the current immutable object by setting a value for the level attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for level
      Returns:
      A modified copy of the this object
    • withType

      Copy the current immutable object by setting a value for the type attribute. A value equality check is 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
    • withExpression

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

      public final ImmutableFormValidationError withExpression(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the expression 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 expression
      Returns:
      A modified copy of this object
    • withStartIndex

      public final ImmutableFormValidationError withStartIndex(int value)
      Copy the current immutable object by setting a present value for the optional startIndex attribute.
      Parameters:
      value - The value for startIndex
      Returns:
      A modified copy of this object
    • withStartIndex

      public final ImmutableFormValidationError withStartIndex(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the startIndex 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 startIndex
      Returns:
      A modified copy of this object
    • withEndIndex

      public final ImmutableFormValidationError withEndIndex(int value)
      Copy the current immutable object by setting a present value for the optional endIndex attribute.
      Parameters:
      value - The value for endIndex
      Returns:
      A modified copy of this object
    • withEndIndex

      public final ImmutableFormValidationError withEndIndex(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the endIndex 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 endIndex
      Returns:
      A modified copy of this object
    • withIndex

      public final ImmutableFormValidationError withIndex(int value)
      Copy the current immutable object by setting a present value for the optional index attribute.
      Parameters:
      value - The value for index
      Returns:
      A modified copy of this object
    • withIndex

      public final ImmutableFormValidationError withIndex(Optional<Integer> optional)
      Copy the current immutable object by setting an optional value for the index 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 index
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableFormValidationError 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: itemId, message, level, type, expression, startIndex, endIndex, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableFormValidationError.Builder builder()
      Creates a builder for ImmutableFormValidationError.
       ImmutableFormValidationError.builder()
          .itemId(String | null) // nullable itemId
          .message(String | null) // nullable message
          .level(io.dialob.api.form.FormValidationError.Level) // optional level
          .type(io.dialob.api.form.FormValidationError.Type | null) // nullable type
          .expression(String) // optional expression
          .startIndex(Integer) // optional startIndex
          .endIndex(Integer) // optional endIndex
          .index(Integer) // optional index
          .build();
       
      Returns:
      A new ImmutableFormValidationError builder