Class ErrorResponse

  • All Implemented Interfaces:
    java.io.Serializable

    public class ErrorResponse
    extends java.lang.RuntimeException
    ErrorResponse

    An object that complies with RFC 9457 containing information about a request error

    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ErrorResponse.Builder  
    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorResponse()  
      ErrorResponse​(java.util.Optional<java.lang.String> type, java.util.Optional<java.lang.Long> status, java.util.Optional<java.lang.String> title, java.util.Optional<java.lang.String> detail, java.util.Optional<java.lang.String> code, java.util.Optional<java.lang.String> instance)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ErrorResponse.Builder builder()  
      java.util.Optional<java.lang.String> code()
      An API specific error code aiding the provider team understand the error based on their own potential taxonomy or registry
      java.util.Optional<java.lang.String> detail()
      A human-readable explanation specific to this occurrence of the problem
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.util.Optional<java.lang.String> instance()
      A URI reference that identifies the specific occurrence of the problem
      java.util.Optional<java.lang.Long> status()
      The HTTP status code generated by the origin server for this occurrence of the problem
      java.util.Optional<java.lang.String> title()
      A short, human-readable summary of the problem type
      java.lang.String toString()  
      java.util.Optional<java.lang.String> type()
      A URI reference that identifies the problem type
      ErrorResponse withCode​(java.lang.String code)
      An API specific error code aiding the provider team understand the error based on their own potential taxonomy or registry
      ErrorResponse withCode​(java.util.Optional<java.lang.String> code)
      An API specific error code aiding the provider team understand the error based on their own potential taxonomy or registry
      ErrorResponse withDetail​(java.lang.String detail)
      A human-readable explanation specific to this occurrence of the problem
      ErrorResponse withDetail​(java.util.Optional<java.lang.String> detail)
      A human-readable explanation specific to this occurrence of the problem
      ErrorResponse withInstance​(java.lang.String instance)
      A URI reference that identifies the specific occurrence of the problem
      ErrorResponse withInstance​(java.util.Optional<java.lang.String> instance)
      A URI reference that identifies the specific occurrence of the problem
      ErrorResponse withStatus​(long status)
      The HTTP status code generated by the origin server for this occurrence of the problem
      ErrorResponse withStatus​(java.util.Optional<java.lang.Long> status)
      The HTTP status code generated by the origin server for this occurrence of the problem
      ErrorResponse withTitle​(java.lang.String title)
      A short, human-readable summary of the problem type
      ErrorResponse withTitle​(java.util.Optional<java.lang.String> title)
      A short, human-readable summary of the problem type
      ErrorResponse withType​(java.lang.String type)
      A URI reference that identifies the problem type
      ErrorResponse withType​(java.util.Optional<java.lang.String> type)
      A URI reference that identifies the problem type
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ErrorResponse

        public ErrorResponse​(java.util.Optional<java.lang.String> type,
                             java.util.Optional<java.lang.Long> status,
                             java.util.Optional<java.lang.String> title,
                             java.util.Optional<java.lang.String> detail,
                             java.util.Optional<java.lang.String> code,
                             java.util.Optional<java.lang.String> instance)
      • ErrorResponse

        public ErrorResponse()
    • Method Detail

      • type

        public java.util.Optional<java.lang.String> type()
        A URI reference that identifies the problem type
      • status

        public java.util.Optional<java.lang.Long> status()
        The HTTP status code generated by the origin server for this occurrence of the problem
      • title

        public java.util.Optional<java.lang.String> title()
        A short, human-readable summary of the problem type
      • detail

        public java.util.Optional<java.lang.String> detail()
        A human-readable explanation specific to this occurrence of the problem
      • code

        public java.util.Optional<java.lang.String> code()
        An API specific error code aiding the provider team understand the error based on their own potential taxonomy or registry
      • instance

        public java.util.Optional<java.lang.String> instance()
        A URI reference that identifies the specific occurrence of the problem
      • withType

        public ErrorResponse withType​(java.lang.String type)
        A URI reference that identifies the problem type
      • withType

        public ErrorResponse withType​(java.util.Optional<java.lang.String> type)
        A URI reference that identifies the problem type
      • withStatus

        public ErrorResponse withStatus​(long status)
        The HTTP status code generated by the origin server for this occurrence of the problem
      • withStatus

        public ErrorResponse withStatus​(java.util.Optional<java.lang.Long> status)
        The HTTP status code generated by the origin server for this occurrence of the problem
      • withTitle

        public ErrorResponse withTitle​(java.lang.String title)
        A short, human-readable summary of the problem type
      • withTitle

        public ErrorResponse withTitle​(java.util.Optional<java.lang.String> title)
        A short, human-readable summary of the problem type
      • withDetail

        public ErrorResponse withDetail​(java.lang.String detail)
        A human-readable explanation specific to this occurrence of the problem
      • withDetail

        public ErrorResponse withDetail​(java.util.Optional<java.lang.String> detail)
        A human-readable explanation specific to this occurrence of the problem
      • withCode

        public ErrorResponse withCode​(java.lang.String code)
        An API specific error code aiding the provider team understand the error based on their own potential taxonomy or registry
      • withCode

        public ErrorResponse withCode​(java.util.Optional<java.lang.String> code)
        An API specific error code aiding the provider team understand the error based on their own potential taxonomy or registry
      • withInstance

        public ErrorResponse withInstance​(java.lang.String instance)
        A URI reference that identifies the specific occurrence of the problem
      • withInstance

        public ErrorResponse withInstance​(java.util.Optional<java.lang.String> instance)
        A URI reference that identifies the specific occurrence of the problem
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Throwable