Class ErrorResponseBuilder
- All Implemented Interfaces:
Builder<ErrorResponse>
Example to create an instance using the builder pattern
ErrorResponse errorResponse = ErrorResponse.builder()
.statusCode(1)
.message("{message}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ErrorResponse with checking for non-null required valuesbuilds ErrorResponse without checking for non-null required valuesThis property is only used for OAuth2 errors.error_description
(String error_description) This property is only used for OAuth2 errors.errors
(ErrorObject... errors) The errors that caused this error response.errors
(List<ErrorObject> errors) The errors that caused this error response.getError()
This property is only used for OAuth2 errors.This property is only used for OAuth2 errors.The errors that caused this error response.Describes the error.The HTTP status code of the response.Describes the error.static ErrorResponseBuilder
of()
factory method for an instance of ErrorResponseBuilderstatic ErrorResponseBuilder
of
(ErrorResponse template) create builder for ErrorResponse instanceplusErrors
(ErrorObject... errors) The errors that caused this error response.plusErrors
(Function<ErrorObjectBuilder, Builder<? extends ErrorObject>> builder) The errors that caused this error response.statusCode
(Integer statusCode) The HTTP status code of the response.withErrors
(Function<ErrorObjectBuilder, Builder<? extends ErrorObject>> builder) The errors that caused this error response.
-
Constructor Details
-
ErrorResponseBuilder
public ErrorResponseBuilder()
-
-
Method Details
-
statusCode
The HTTP status code of the response.
- Parameters:
statusCode
- value to be set- Returns:
- Builder
-
message
Describes the error.
- Parameters:
message
- value to be set- Returns:
- Builder
-
error
This property is only used for OAuth2 errors. Contains the error code.
- Parameters:
error
- value to be set- Returns:
- Builder
-
error_description
This property is only used for OAuth2 errors. Additional information to assist the client developer in understanding the error.
- Parameters:
error_description
- value to be set- Returns:
- Builder
-
errors
The errors that caused this error response.
- Parameters:
errors
- value to be set- Returns:
- Builder
-
errors
The errors that caused this error response.
- Parameters:
errors
- value to be set- Returns:
- Builder
-
plusErrors
The errors that caused this error response.
- Parameters:
errors
- value to be set- Returns:
- Builder
-
plusErrors
public ErrorResponseBuilder plusErrors(Function<ErrorObjectBuilder, Builder<? extends ErrorObject>> builder) The errors that caused this error response.
- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
withErrors
public ErrorResponseBuilder withErrors(Function<ErrorObjectBuilder, Builder<? extends ErrorObject>> builder) The errors that caused this error response.
- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
getStatusCode
The HTTP status code of the response.
- Returns:
- statusCode
-
getMessage
Describes the error.
- Returns:
- message
-
getError
This property is only used for OAuth2 errors. Contains the error code.
- Returns:
- error
-
getError_description
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
-
build
builds ErrorResponse with checking for non-null required values- Specified by:
build
in interfaceBuilder<ErrorResponse>
- Returns:
- ErrorResponse
-
buildUnchecked
builds ErrorResponse without checking for non-null required values- Returns:
- ErrorResponse
-
of
factory method for an instance of ErrorResponseBuilder- Returns:
- builder
-
of
create builder for ErrorResponse instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-