public class ClientResponseWrapper extends java.lang.Object implements ClientResponse
ClientResponse
interface that can be subclassed
to adapt the request in a
exchange filter function
.
All methods default to calling through to the wrapped request.Modifier and Type | Class and Description |
---|---|
static class |
ClientResponseWrapper.HeadersWrapper
Implementation of the
Headers interface that can be subclassed
to adapt the headers in a
exchange filter function . |
ClientResponse.Builder, ClientResponse.Headers
Modifier and Type | Field and Description |
---|---|
private ClientResponse |
delegate |
Constructor and Description |
---|
ClientResponseWrapper(ClientResponse delegate)
Create a new
ClientResponseWrapper that wraps the given response. |
Modifier and Type | Method and Description |
---|---|
<T> T |
body(BodyExtractor<T,? super ClientHttpResponse> extractor)
Extract the body with the given
BodyExtractor . |
<T> <any> |
bodyToFlux(java.lang.Class<? extends T> elementClass)
Extract the body to a
Flux . |
<T> <any> |
bodyToFlux(ParameterizedTypeReference<T> typeReference)
Extract the body to a
Flux . |
<T> <any> |
bodyToMono(java.lang.Class<? extends T> elementClass)
Extract the body to a
Mono . |
<T> <any> |
bodyToMono(ParameterizedTypeReference<T> typeReference)
Extract the body to a
Mono . |
MultiValueMap<java.lang.String,ResponseCookie> |
cookies()
Return cookies of this response.
|
ClientResponse.Headers |
headers()
Return the headers of this response.
|
int |
rawStatusCode()
Return the (potentially non-standard) status code of this response.
|
ClientResponse |
response()
Return the wrapped request.
|
HttpStatus |
statusCode()
Return the status code of this response.
|
ExchangeStrategies |
strategies()
Return the strategies used to convert the body of this response.
|
<T> <any> |
toEntity(java.lang.Class<T> bodyType)
Return this response as a delayed
ResponseEntity . |
<T> <any> |
toEntity(ParameterizedTypeReference<T> typeReference)
Return this response as a delayed
ResponseEntity . |
<T> <any> |
toEntityList(java.lang.Class<T> elementType)
Return this response as a delayed list of
ResponseEntity s. |
<T> <any> |
toEntityList(ParameterizedTypeReference<T> typeReference)
Return this response as a delayed list of
ResponseEntity s. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, create, create, from
private final ClientResponse delegate
public ClientResponseWrapper(ClientResponse delegate)
ClientResponseWrapper
that wraps the given response.delegate
- the response to wrappublic ClientResponse response()
public ExchangeStrategies strategies()
ClientResponse
strategies
in interface ClientResponse
public HttpStatus statusCode()
ClientResponse
statusCode
in interface ClientResponse
HttpStatus.valueOf(int)
public int rawStatusCode()
ClientResponse
rawStatusCode
in interface ClientResponse
ClientResponse.statusCode()
,
HttpStatus.resolve(int)
public ClientResponse.Headers headers()
ClientResponse
headers
in interface ClientResponse
public MultiValueMap<java.lang.String,ResponseCookie> cookies()
ClientResponse
cookies
in interface ClientResponse
public <T> T body(BodyExtractor<T,? super ClientHttpResponse> extractor)
ClientResponse
BodyExtractor
.body
in interface ClientResponse
T
- the type of the body returnedextractor
- the BodyExtractor
that reads from the responsepublic <T> <any> bodyToMono(java.lang.Class<? extends T> elementClass)
ClientResponse
Mono
.bodyToMono
in interface ClientResponse
T
- the element typeelementClass
- the class of element in the Mono
T
public <T> <any> bodyToMono(ParameterizedTypeReference<T> typeReference)
ClientResponse
Mono
.bodyToMono
in interface ClientResponse
T
- the element typetypeReference
- a type reference describing the expected response body typeT
public <T> <any> bodyToFlux(java.lang.Class<? extends T> elementClass)
ClientResponse
Flux
.bodyToFlux
in interface ClientResponse
T
- the element typeelementClass
- the class of element in the Flux
T
public <T> <any> bodyToFlux(ParameterizedTypeReference<T> typeReference)
ClientResponse
Flux
.bodyToFlux
in interface ClientResponse
T
- the element typetypeReference
- a type reference describing the expected response body typeT
public <T> <any> toEntity(java.lang.Class<T> bodyType)
ClientResponse
ResponseEntity
.toEntity
in interface ClientResponse
T
- response body typebodyType
- the expected response body typeMono
with the ResponseEntity
public <T> <any> toEntity(ParameterizedTypeReference<T> typeReference)
ClientResponse
ResponseEntity
.toEntity
in interface ClientResponse
T
- response body typetypeReference
- a type reference describing the expected response body typeMono
with the ResponseEntity
public <T> <any> toEntityList(java.lang.Class<T> elementType)
ClientResponse
ResponseEntity
s.toEntityList
in interface ClientResponse
T
- the type of elements in the listelementType
- the expected response body list element typeMono
with the list of ResponseEntity
spublic <T> <any> toEntityList(ParameterizedTypeReference<T> typeReference)
ClientResponse
ResponseEntity
s.toEntityList
in interface ClientResponse
T
- the type of elements in the listtypeReference
- a type reference describing the expected response body typeMono
with the list of ResponseEntity
s