public class ClientResponseWrapper extends 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| 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> reactor.core.publisher.Flux<T> |
bodyToFlux(Class<? extends T> elementClass)
Extract the body to a
Flux. |
<T> reactor.core.publisher.Flux<T> |
bodyToFlux(ParameterizedTypeReference<T> typeReference)
Extract the body to a
Flux. |
<T> reactor.core.publisher.Mono<T> |
bodyToMono(Class<? extends T> elementClass)
Extract the body to a
Mono. |
<T> reactor.core.publisher.Mono<T> |
bodyToMono(ParameterizedTypeReference<T> typeReference)
Extract the body to a
Mono. |
MultiValueMap<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> reactor.core.publisher.Mono<ResponseEntity<T>> |
toEntity(Class<T> bodyType)
Return this response as a delayed
ResponseEntity. |
<T> reactor.core.publisher.Mono<ResponseEntity<T>> |
toEntity(ParameterizedTypeReference<T> typeReference)
Return this response as a delayed
ResponseEntity. |
<T> reactor.core.publisher.Mono<ResponseEntity<List<T>>> |
toEntityList(Class<T> elementType)
Return this response as a delayed list of
ResponseEntitys. |
<T> reactor.core.publisher.Mono<ResponseEntity<List<T>>> |
toEntityList(ParameterizedTypeReference<T> typeReference)
Return this response as a delayed list of
ResponseEntitys. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, create, frompublic ClientResponseWrapper(ClientResponse delegate)
ClientResponseWrapper that wraps the given response.delegate - the response to wrappublic ClientResponse response()
public ExchangeStrategies strategies()
ClientResponsestrategies in interface ClientResponsepublic HttpStatus statusCode()
ClientResponsestatusCode in interface ClientResponseHttpStatus.valueOf(int)public int rawStatusCode()
ClientResponserawStatusCode in interface ClientResponseClientResponse.statusCode(),
HttpStatus.resolve(int)public ClientResponse.Headers headers()
ClientResponseheaders in interface ClientResponsepublic MultiValueMap<String,ResponseCookie> cookies()
ClientResponsecookies in interface ClientResponsepublic <T> T body(BodyExtractor<T,? super ClientHttpResponse> extractor)
ClientResponseBodyExtractor.body in interface ClientResponseT - the type of the body returnedextractor - the BodyExtractor that reads from the responsepublic <T> reactor.core.publisher.Mono<T> bodyToMono(Class<? extends T> elementClass)
ClientResponseMono.bodyToMono in interface ClientResponseT - the element typeelementClass - the class of element in the MonoTpublic <T> reactor.core.publisher.Mono<T> bodyToMono(ParameterizedTypeReference<T> typeReference)
ClientResponseMono.bodyToMono in interface ClientResponseT - the element typetypeReference - a type reference describing the expected response body typeTpublic <T> reactor.core.publisher.Flux<T> bodyToFlux(Class<? extends T> elementClass)
ClientResponseFlux.bodyToFlux in interface ClientResponseT - the element typeelementClass - the class of element in the FluxTpublic <T> reactor.core.publisher.Flux<T> bodyToFlux(ParameterizedTypeReference<T> typeReference)
ClientResponseFlux.bodyToFlux in interface ClientResponseT - the element typetypeReference - a type reference describing the expected response body typeTpublic <T> reactor.core.publisher.Mono<ResponseEntity<T>> toEntity(Class<T> bodyType)
ClientResponseResponseEntity.toEntity in interface ClientResponseT - response body typebodyType - the expected response body typeMono with the ResponseEntitypublic <T> reactor.core.publisher.Mono<ResponseEntity<T>> toEntity(ParameterizedTypeReference<T> typeReference)
ClientResponseResponseEntity.toEntity in interface ClientResponseT - response body typetypeReference - a type reference describing the expected response body typeMono with the ResponseEntitypublic <T> reactor.core.publisher.Mono<ResponseEntity<List<T>>> toEntityList(Class<T> elementType)
ClientResponseResponseEntitys.toEntityList in interface ClientResponseT - the type of elements in the listelementType - the expected response body list element typeMono with the list of ResponseEntityspublic <T> reactor.core.publisher.Mono<ResponseEntity<List<T>>> toEntityList(ParameterizedTypeReference<T> typeReference)
ClientResponseResponseEntitys.toEntityList in interface ClientResponseT - the type of elements in the listtypeReference - a type reference describing the expected response body typeMono with the list of ResponseEntitys