Class ImmutableExceptionMapping

java.lang.Object
org.bremersee.exception.ImmutableExceptionMapping
All Implemented Interfaces:
RestApiExceptionMapperProperties.ExceptionMapping

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableExceptionMapping extends Object implements RestApiExceptionMapperProperties.ExceptionMapping
Immutable implementation of RestApiExceptionMapperProperties.ExceptionMapping.

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

  • Method Details

    • getExceptionClassName

      public String getExceptionClassName()
      Gets exception class name.
      Specified by:
      getExceptionClassName in interface RestApiExceptionMapperProperties.ExceptionMapping
      Returns:
      the exception class name
    • getStatus

      public int getStatus()
      Gets status.
      Specified by:
      getStatus in interface RestApiExceptionMapperProperties.ExceptionMapping
      Returns:
      the status
    • getMessage

      @Nullable public String getMessage()
      Gets message.
      Specified by:
      getMessage in interface RestApiExceptionMapperProperties.ExceptionMapping
      Returns:
      the message
    • getCode

      @Nullable public String getCode()
      Gets code.
      Specified by:
      getCode in interface RestApiExceptionMapperProperties.ExceptionMapping
      Returns:
      the code
    • withExceptionClassName

      public final ImmutableExceptionMapping withExceptionClassName(String value)
      Copy the current immutable object by setting a value for the exceptionClassName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for exceptionClassName
      Returns:
      A modified copy of the this object
    • withStatus

      public final ImmutableExceptionMapping withStatus(int value)
      Copy the current immutable object by setting a value for the status attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for status
      Returns:
      A modified copy of the this object
    • withMessage

      public final ImmutableExceptionMapping withMessage(@Nullable 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
    • withCode

      public final ImmutableExceptionMapping 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
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableExceptionMapping 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: exceptionClassName, status, message, code.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a RestApiExceptionMapperProperties.ExceptionMapping 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 ExceptionMapping instance
    • builder

      public static ImmutableExceptionMapping.Builder builder()
      Creates a builder for ImmutableExceptionMapping.
       ImmutableExceptionMapping.builder()
          .exceptionClassName(String) // required exceptionClassName
          .status(int) // optional status
          .message(String | null) // nullable message
          .code(String | null) // nullable code
          .build();
       
      Returns:
      A new ImmutableExceptionMapping builder