Interface ResponseTransformation.Builder<T>

All Superinterfaces:
Buildable<ResponseTransformation<T>>
Enclosing interface:
ResponseTransformation<T>

public static interface ResponseTransformation.Builder<T> extends Buildable<ResponseTransformation<T>>
  • 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 on
      f - The transformation function
      Returns:
      This instance for chaining
      See Also:
    • on

      ResponseTransformation.Builder<T> on(int statusCode, Function<Response, ? extends T> f)

      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 on
      f - The transformation function
      Returns:
      This instance for chaining
      See Also:
    • informational

      ResponseTransformation.Builder<T> informational(Function<Response, ? extends T> f)
      Register a function to transform 'informational' (1xx) HTTP responses.
      Parameters:
      f - The transformation function
      Returns:
      This instance for chaining
    • successful

      ResponseTransformation.Builder<T> successful(Function<Response, ? extends T> f)
      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

      ResponseTransformation.Builder<T> noContent(Function<Response, ? extends T> f)
      Register a function to transform 'no content' (204) HTTP responses.
      Parameters:
      f - The transformation function
      Returns:
      This instance for chaining
    • redirection

      ResponseTransformation.Builder<T> redirection(Function<Response, ? extends T> f)
      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

      ResponseTransformation.Builder<T> notModified(Function<Response, ? extends T> f)
      Register a function to transform 'not modified' (304) HTTP responses.
      Parameters:
      f - The transformation function
      Returns:
      This instance for chaining
    • clientError

      ResponseTransformation.Builder<T> clientError(Function<Response, ? extends T> f)
      Register a function to transform 'client error' (4xx) HTTP responses.
      Parameters:
      f - The transformation function
      Returns:
      This instance for chaining
    • badRequest

      ResponseTransformation.Builder<T> badRequest(Function<Response, ? extends T> f)
      Register a function to transform 'bad request' (400) HTTP responses.
      Parameters:
      f - The transformation function
      Returns:
      This instance for chaining
    • unauthorized

      ResponseTransformation.Builder<T> unauthorized(Function<Response, ? extends T> f)
      Register a function to transform 'unauthorized' (401) HTTP responses.
      Parameters:
      f - The transformation function
      Returns:
      This instance for chaining
    • forbidden

      ResponseTransformation.Builder<T> forbidden(Function<Response, ? extends T> f)
      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

      ResponseTransformation.Builder<T> serverError(Function<Response, ? extends T> f)
      Register a function to transform 'server error' (5xx) HTTP responses.
      Parameters:
      f - The transformation function
      Returns:
      This instance for chaining
    • internalServerError

      ResponseTransformation.Builder<T> internalServerError(Function<Response, ? extends T> f)
      Register a function to transform 'internal server error' (500) HTTP responses.
      Parameters:
      f - The transformation function
      Returns:
      This instance for chaining
    • serviceUnavailable

      ResponseTransformation.Builder<T> serviceUnavailable(Function<Response, ? extends T> f)
      Register a function to transform 'service unavailable' (503) 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

      ResponseTransformation.Builder<T> notSuccessful(Function<Response, ? extends T> f)
      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
    • 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