class DefaultClientResponse extends java.lang.Object implements ClientResponse
ClientResponse
.Modifier and Type | Class and Description |
---|---|
private class |
DefaultClientResponse.DefaultHeaders |
private static class |
DefaultClientResponse.ReadCancellationException |
ClientResponse.Builder, ClientResponse.Headers
Modifier and Type | Field and Description |
---|---|
private ClientResponse.Headers |
headers |
private ClientHttpResponse |
response |
private ExchangeStrategies |
strategies |
Constructor and Description |
---|
DefaultClientResponse(ClientHttpResponse response,
ExchangeStrategies strategies) |
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 . |
private <T> <any> |
consumeAndCancel() |
MultiValueMap<java.lang.String,ResponseCookie> |
cookies()
Return cookies of this response.
|
ClientResponse.Headers |
headers()
Return the headers of this response.
|
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 . |
private <T> <any> |
toEntityInternal(<any> bodyMono) |
<T> <any> |
toEntityList(java.lang.Class<T> responseType)
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. |
private <T> <any> |
toEntityListInternal(<any> bodyFlux) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, create, create, from
private final ClientHttpResponse response
private final ClientResponse.Headers headers
private final ExchangeStrategies strategies
public DefaultClientResponse(ClientHttpResponse response, ExchangeStrategies strategies)
public ExchangeStrategies strategies()
ClientResponse
strategies
in interface ClientResponse
public HttpStatus statusCode()
ClientResponse
statusCode
in interface ClientResponse
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
private <T> <any> consumeAndCancel()
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
private <T> <any> toEntityInternal(<any> bodyMono)
public <T> <any> toEntityList(java.lang.Class<T> responseType)
ClientResponse
ResponseEntity
s.toEntityList
in interface ClientResponse
T
- the type of elements in the listresponseType
- 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
sprivate <T> <any> toEntityListInternal(<any> bodyFlux)