public abstract static class ResponseTransformation.Builder<O>
extends java.lang.Object
| Constructor and Description |
|---|
ResponseTransformation.Builder() |
| Modifier and Type | Method and Description |
|---|---|
abstract ResponseTransformation.Builder<O> |
badRequest(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'bad request' (400) HTTP responses.
|
abstract ResponseTransformation<O> |
build() |
static <O> ResponseTransformation.Builder<O> |
builder() |
abstract ResponseTransformation.Builder<O> |
clientError(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'client error' (4xx) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
conflict(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'conflict' (409) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
created(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'created' (201) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
done(com.google.common.base.Function<Response,O> f)
Register a function to transform all completed (1xx, 2xx, 3xx, 4xx, and 5xx) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
error(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform all error (4xx and 5xx) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
fail(com.google.common.base.Function<java.lang.Throwable,? extends O> f)
Register a function to transform exceptions thrown while executing the HTTP request.
|
abstract ResponseTransformation.Builder<O> |
forbidden(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'forbidden' (403) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
informational(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'informational' (1xx) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
internalServerError(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'internal server error' (500) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
noContent(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'no content' (204) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
notFound(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'not found' (404) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
notModified(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'not modified' (304) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
notSuccessful(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform all non-'successful' (1xx, 3xx, 4xx, 5xx) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
ok(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'ok' (200) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
on(HttpStatus status,
com.google.common.base.Function<Response,? extends O> f)
Register a function to transform HTTP responses with a specific status.
|
abstract ResponseTransformation.Builder<O> |
on(int statusCode,
com.google.common.base.Function<Response,? extends O> f)
Register a function to transform HTTP responses with a specific status code.
|
abstract ResponseTransformation.Builder<O> |
others(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform all other HTTP responses (i.e.
|
abstract ResponseTransformation.Builder<O> |
otherwise(com.google.common.base.Function<java.lang.Throwable,O> f)
Register a function to transform both of the following events: Any value passed to
fail() Any value passed to others(), converted into an exception |
abstract ResponseTransformation.Builder<O> |
redirection(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'redirection' (3xx) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
seeOther(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'see other' (303) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
serverError(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'server error' (5xx) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
serviceUnavailable(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'service unavailable' (503) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
successful(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'successful' (2xx) HTTP responses.
|
abstract ResponseTransformation.Builder<O> |
unauthorized(com.google.common.base.Function<Response,? extends O> f)
Register a function to transform 'unauthorized' (401) HTTP responses.
|
public static <O> ResponseTransformation.Builder<O> builder()
public abstract ResponseTransformation.Builder<O> on(HttpStatus status, com.google.common.base.Function<Response,? extends O> f)
status - The HTTP status to select onf - The transformation functionon(int, com.google.common.base.Function)public abstract ResponseTransformation.Builder<O> on(int statusCode, com.google.common.base.Function<Response,? extends O> f)
on(HttpStatus, com.google.common.base.Function) method if you're using standard
HTTP status.statusCode - The code to select onf - The transformation functionon(HttpStatus, com.google.common.base.Function)public abstract ResponseTransformation.Builder<O> informational(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> successful(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> ok(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> created(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> noContent(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> redirection(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> seeOther(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> notModified(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> clientError(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> badRequest(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> unauthorized(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> forbidden(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> notFound(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> conflict(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> serverError(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> internalServerError(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> serviceUnavailable(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> error(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> notSuccessful(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> others(com.google.common.base.Function<Response,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> otherwise(com.google.common.base.Function<java.lang.Throwable,O> f)
fail()f - The transformation functionpublic abstract ResponseTransformation.Builder<O> done(com.google.common.base.Function<Response,O> f)
f - The transformation functionpublic abstract ResponseTransformation.Builder<O> fail(com.google.common.base.Function<java.lang.Throwable,? extends O> f)
f - The transformation functionpublic abstract ResponseTransformation<O> build()
Copyright © 2012-2013 Atlassian. All Rights Reserved.