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 Summary
Modifier and TypeMethodDescriptionstatic ErrorResponseBuilder
builder()
builder factory method for ErrorResponsestatic ErrorResponseBuilder
builder
(ErrorResponse template) create builder for ErrorResponse instancestatic ErrorResponse
deepCopy
(ErrorResponse template) factory method to create a deep copy of ErrorResponsegetError()
This property is only used for OAuth2 errors.This property is only used for OAuth2 errors.@Valid List<ErrorObject>
The errors that caused this error response.@NotNull String
Describes the error.@NotNull Integer
The HTTP status code of the response.static ErrorResponse
of()
factory methodstatic ErrorResponse
of
(ErrorResponse template) factory method to create a shallow copy ErrorResponsevoid
This property is only used for OAuth2 errors.void
setErrorDescription
(String errorDescription) This property is only used for OAuth2 errors.void
setErrors
(ErrorObject... errors) The errors that caused this error response.void
setErrors
(List<ErrorObject> errors) The errors that caused this error response.void
setMessage
(String message) Describes the error.void
setStatusCode
(Integer statusCode) The HTTP status code of the response.static com.fasterxml.jackson.core.type.TypeReference<ErrorResponse>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withErrorResponse
(Function<ErrorResponse, T> helper) accessor map function
-
Method Details
-
getStatusCode
The HTTP status code of the response.
- Returns:
- statusCode
-
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
The errors that caused this error response.
- Returns:
- errors
-
setStatusCode
The HTTP status code of the response.
- Parameters:
statusCode
- value to be set
-
setMessage
Describes the error.
- Parameters:
message
- value to be set
-
setError
This property is only used for OAuth2 errors. Contains the error code.
- Parameters:
error
- value to be set
-
setErrorDescription
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
The errors that caused this error response.
- Parameters:
errors
- values to be set
-
setErrors
The errors that caused this error response.
- Parameters:
errors
- values to be set
-
of
factory method- Returns:
- instance of ErrorResponse
-
of
factory method to create a shallow copy ErrorResponse- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ErrorResponse- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ErrorResponse- Returns:
- builder
-
builder
create builder for ErrorResponse instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withErrorResponse
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-