Class ImmutableFormPutResponse

java.lang.Object
io.dialob.api.form.ImmutableFormPutResponse
All Implemented Interfaces:
FormPutResponse, Response, ResponseStatus, Serializable

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

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

See Also:
  • Method Details

    • getOk

      public Boolean getOk()
      Specified by:
      getOk in interface ResponseStatus
      Returns:
      The value of the ok attribute
    • getError

      public String getError()
      Specified by:
      getError in interface Response
      Returns:
      The value of the error attribute
    • getReason

      public String getReason()
      Specified by:
      getReason in interface Response
      Returns:
      The value of the reason attribute
    • getId

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

      public String getRev()
      Specified by:
      getRev in interface FormPutResponse
      Returns:
      The value of the rev attribute
    • getErrors

      public List<FormValidationError> getErrors()
      Specified by:
      getErrors in interface FormPutResponse
      Returns:
      The value of the errors attribute
    • getForm

      public Form getForm()
      Specified by:
      getForm in interface FormPutResponse
      Returns:
      The value of the form attribute
    • withOk

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

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

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

      public final ImmutableFormPutResponse 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
    • withRev

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

      public final ImmutableFormPutResponse withErrors(FormValidationError... 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 ImmutableFormPutResponse withErrors(Iterable<? extends FormValidationError> 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
    • withForm

      public final ImmutableFormPutResponse withForm(Form value)
      Copy the current immutable object by setting a value for the form attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for form (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 ImmutableFormPutResponse 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: ok, error, reason, id, rev, errors, form.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableFormPutResponse.Builder builder()
      Creates a builder for ImmutableFormPutResponse.
       ImmutableFormPutResponse.builder()
          .ok(Boolean | null) // nullable ok
          .error(String | null) // nullable error
          .reason(String | null) // nullable reason
          .id(String | null) // nullable id
          .rev(String | null) // nullable rev
          .addErrors|addAllErrors(io.dialob.api.form.FormValidationError) // errors elements
          .form(io.dialob.api.form.Form | null) // nullable form
          .build();
       
      Returns:
      A new ImmutableFormPutResponse builder