Interface ResponseTransformation.Builder<T>
- All Superinterfaces:
Buildable<ResponseTransformation<T>>
- Enclosing interface:
ResponseTransformation<T>
public static interface ResponseTransformation.Builder<T>
extends Buildable<ResponseTransformation<T>>
-
Method Summary
Modifier and TypeMethodDescriptionbadRequest(Function<Response, ? extends T> f) Register a function to transform 'bad request' (400) HTTP responses.clientError(Function<Response, ? extends T> f) Register a function to transform 'client error' (4xx) HTTP responses.Register a function to transform 'conflict' (409) HTTP responses.Register a function to transform 'created' (201) HTTP responses.Register a function to transform all completed (1xx, 2xx, 3xx, 4xx, and 5xx) HTTP responses.Register a function to transform all error (4xx and 5xx) HTTP responses.Register a function to transform exceptions thrown while executing the HTTP request.Register a function to transform 'forbidden' (403) HTTP responses.informational(Function<Response, ? extends T> f) Register a function to transform 'informational' (1xx) HTTP responses.internalServerError(Function<Response, ? extends T> f) Register a function to transform 'internal server error' (500) HTTP responses.Register a function to transform 'no content' (204) HTTP responses.Register a function to transform 'not found' (404) HTTP responses.notModified(Function<Response, ? extends T> f) Register a function to transform 'not modified' (304) HTTP responses.notSuccessful(Function<Response, ? extends T> f) Register a function to transform all non-'successful' (1xx, 3xx, 4xx, 5xx) HTTP responses.Register a function to transform 'ok' (200) HTTP responses.Register a function to transform HTTP responses with a specific status code.on(HttpStatus status, Function<Response, ? extends T> f) Register a function to transform HTTP responses with a specific status.Register a function to transform all other HTTP responses (i.e. those not explicitly registered for).Register a function to transform both of the following events: Any value passed tofail()Any value passed to others(), converted into an exceptionredirection(Function<Response, ? extends T> f) Register a function to transform 'redirection' (3xx) HTTP responses.Register a function to transform 'see other' (303) HTTP responses.serverError(Function<Response, ? extends T> f) Register a function to transform 'server error' (5xx) HTTP responses.serviceUnavailable(Function<Response, ? extends T> f) Register a function to transform 'service unavailable' (503) HTTP responses.successful(Function<Response, ? extends T> f) Register a function to transform 'successful' (2xx) HTTP responses.unauthorized(Function<Response, ? extends T> f) Register a function to transform 'unauthorized' (401) HTTP responses.
-
Method Details
-
on
Register a function to transform HTTP responses with a specific status. Use this as a fallback if the status code you're interested in does not have a more explicit registration method for it.- Parameters:
status- The HTTP status to select onf- The transformation function- Returns:
- This instance for chaining
- See Also:
-
on
Register a function to transform HTTP responses with a specific status code. Use this as a fallback if the status code you're interested in does not have a more explicit registration method for it.
Prefer the
on(HttpStatus, Function)method if you're using standard HTTP status.- Parameters:
statusCode- The code to select onf- The transformation function- Returns:
- This instance for chaining
- See Also:
-
informational
Register a function to transform 'informational' (1xx) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
successful
Register a function to transform 'successful' (2xx) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
ok
Register a function to transform 'ok' (200) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
created
Register a function to transform 'created' (201) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
noContent
Register a function to transform 'no content' (204) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
redirection
Register a function to transform 'redirection' (3xx) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
seeOther
Register a function to transform 'see other' (303) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
notModified
Register a function to transform 'not modified' (304) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
clientError
Register a function to transform 'client error' (4xx) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
badRequest
Register a function to transform 'bad request' (400) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
unauthorized
Register a function to transform 'unauthorized' (401) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
forbidden
Register a function to transform 'forbidden' (403) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
notFound
Register a function to transform 'not found' (404) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
conflict
Register a function to transform 'conflict' (409) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
serverError
Register a function to transform 'server error' (5xx) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
internalServerError
Register a function to transform 'internal server error' (500) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
error
Register a function to transform all error (4xx and 5xx) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
notSuccessful
Register a function to transform all non-'successful' (1xx, 3xx, 4xx, 5xx) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
others
Register a function to transform all other HTTP responses (i.e. those not explicitly registered for).- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
otherwise
Register a function to transform both of the following events:- Any value passed to
fail() - Any value passed to others(), converted into an exception
- Parameters:
f- The transformation function- Returns:
- This instance for chaining
- Any value passed to
-
done
Register a function to transform all completed (1xx, 2xx, 3xx, 4xx, and 5xx) HTTP responses.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-
fail
Register a function to transform exceptions thrown while executing the HTTP request.- Parameters:
f- The transformation function- Returns:
- This instance for chaining
-