Interface ErrorResponse


public interface ErrorResponse

The response in case of an error.


Example to create an instance using the builder pattern

     ErrorResponse errorResponse = ErrorResponse.builder()
             .statusCode(1)
             .message("{message}")
             .build()
 
  • Method Details

    • getStatusCode

      @NotNull @NotNull Integer getStatusCode()

      The HTTP status code of the response.

      Returns:
      statusCode
    • getMessage

      @NotNull @NotNull String getMessage()

      Describes the error.

      Returns:
      message
    • getError

      String getError()

      This property is only used for OAuth2 errors. Contains the error code.

      Returns:
      error
    • getErrorDescription

      String getErrorDescription()

      This property is only used for OAuth2 errors. Additional information to assist the client developer in understanding the error.

      Returns:
      error_description
    • getErrors

      @Valid @Valid List<ErrorObject> getErrors()

      The errors that caused this error response.

      Returns:
      errors
    • setStatusCode

      void setStatusCode(Integer statusCode)

      The HTTP status code of the response.

      Parameters:
      statusCode - value to be set
    • setMessage

      void setMessage(String message)

      Describes the error.

      Parameters:
      message - value to be set
    • setError

      void setError(String error)

      This property is only used for OAuth2 errors. Contains the error code.

      Parameters:
      error - value to be set
    • setErrorDescription

      void setErrorDescription(String errorDescription)

      This property is only used for OAuth2 errors. Additional information to assist the client developer in understanding the error.

      Parameters:
      errorDescription - value to be set
    • setErrors

      void setErrors(ErrorObject... errors)

      The errors that caused this error response.

      Parameters:
      errors - values to be set
    • setErrors

      void setErrors(List<ErrorObject> errors)

      The errors that caused this error response.

      Parameters:
      errors - values to be set
    • of

      static ErrorResponse of()
      factory method
      Returns:
      instance of ErrorResponse
    • of

      static ErrorResponse of(ErrorResponse template)
      factory method to create a shallow copy ErrorResponse
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ErrorResponse deepCopy(@Nullable ErrorResponse template)
      factory method to create a deep copy of ErrorResponse
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ErrorResponseBuilder builder()
      builder factory method for ErrorResponse
      Returns:
      builder
    • builder

      static ErrorResponseBuilder builder(ErrorResponse template)
      create builder for ErrorResponse instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withErrorResponse

      default <T> T withErrorResponse(Function<ErrorResponse,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ErrorResponse> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference