EntityResponse.Builder implementation.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final MultiValueMap | |
| private final T | |
| private final HttpHeaders | |
| private final Map | |
| private final BodyInserter | |
| private HttpStatusCode |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public EntityResponse. | allow(HttpMethod...
the allowed methods allowedMethods)Implements org. Set the set of allowed |
| public EntityResponse. | allow(Set<HttpMethod>
the allowed methods allowedMethods)Implements org. Set the set of allowed |
| public Mono | build()
Implements org. Build the response. |
| public EntityResponse. | cacheControl(CacheControl
a builder for cache-related HTTP response headers cacheControl)Implements org. Set the caching directives for the resource, as specified by the HTTP 1.1
|
| public EntityResponse. | contentLength(long
the content length contentLength)Implements org. Set the length of the body in bytes, as specified by the
|
| public EntityResponse. | contentType(MediaType
the content type contentType)Implements org. Set the media type of the body, as specified by the
|
| public EntityResponse. | cookie(ResponseCookie
the cookie to add cookie)Implements org. Add the given cookie to the response. |
| public EntityResponse. | cookies(Consumer<MultiValueMap<String, ResponseCookie>>
a function that consumes the cookies cookiesConsumer)Implements org. Manipulate this response's cookies with the given consumer. |
| public EntityResponse. | eTag(String
the new entity tag etag)Implements org. Set the entity tag of the body, as specified by the |
| public EntityResponse. | header(String
the header name headerName, String... the header value(s) headerValues)Implements org. Add the given header value(s) under the given name. |
| public EntityResponse. | headers(HttpHeaders
the existing HttpHeaders to copy from headers)Implements org. Copy the given headers into the entity's headers map. |
| public EntityResponse. | headers(Consumer<HttpHeaders>
a function that consumes the headersConsumer)HttpHeadersImplements org. Manipulate this entity's headers with the given consumer. |
| public EntityResponse. | hint(String
the hint key key, Object the hint value value)Implements org. Add a serialization hint like |
| public EntityResponse. | |
| public EntityResponse. | lastModified(ZonedDateTime
the last modified date lastModified)Implements org. Set the time the resource was last changed, as specified by the
|
| public EntityResponse. | lastModified(Instant
the last modified date lastModified)Implements org. Set the time the resource was last changed, as specified by the
|
| public EntityResponse. | location(URI
the location location)Implements org. Set the location of a resource, as specified by the |
| public EntityResponse. | status(HttpStatusCode
the response status status)Implements org. Set the HTTP status. |
| public EntityResponse. | status(int
the response status status)Implements org. Set the HTTP status. |
| public EntityResponse. | varyBy(String...
request header names requestHeaders)Implements org. Configure one or more request header names (e.g. "Accept-Language") to add to the "Vary" response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers. |
| cookies | back to summary |
|---|---|
| private final MultiValueMap<String, ResponseCookie> cookies | |
| entity | back to summary |
|---|---|
| private final T entity | |
| headers | back to summary |
|---|---|
| private final HttpHeaders headers | |
| hints | back to summary |
|---|---|
| private final Map<String, Object> hints | |
| inserter | back to summary |
|---|---|
| private final BodyInserter<T, ? super ServerHttpResponse> inserter | |
| status | back to summary |
|---|---|
| private HttpStatusCode status | |
| DefaultEntityResponseBuilder | back to summary |
|---|---|
| public DefaultEntityResponseBuilder(T entity, BodyInserter<T, ? super ServerHttpResponse> inserter) | |
| allow | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the set of allowed
| |
| allow | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the set of allowed
| |
| build | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Build the response.
| |
| cacheControl | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the caching directives for the resource, as specified by the HTTP 1.1
A
| |
| contentLength | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the length of the body in bytes, as specified by the
| |
| contentType | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the media type of the body, as specified by the
| |
| cookie | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Add the given cookie to the response.
| |
| cookies | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Manipulate this response's cookies with the given consumer. The
cookies provided to the consumer are "live", so that the consumer can be used to
overwrite existing cookies,
remove cookies, or use any of the other
| |
| eTag | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the entity tag of the body, as specified by the
| |
| header | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Add the given header value(s) under the given name.
| |
| headers | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Copy the given headers into the entity's headers map.
| |
| headers | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Manipulate this entity's headers with the given consumer. The
headers provided to the consumer are "live", so that the consumer can be used to
overwrite existing header values,
remove values, or use any of the other
| |
| hint | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Add a serialization hint like | |
| hints | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Customize the serialization hints with the given consumer. | |
| lastModified | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the time the resource was last changed, as specified by the
The date should be specified as the number of milliseconds since January 1, 1970 GMT.
| |
| lastModified | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the time the resource was last changed, as specified by the
The date should be specified as the number of milliseconds since January 1, 1970 GMT.
| |
| location | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the location of a resource, as specified by the
| |
| status | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the HTTP status.
| |
| status | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Set the HTTP status.
| |
| varyBy | back to summary |
|---|---|
| public EntityResponse. Implements org. Doc from org. Configure one or more request header names (e.g. "Accept-Language") to add to the "Vary" response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers. The configured request header names are added only if not already present in the response "Vary" header.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final T | |
| private final BodyInserter |
| Access | Constructor and Description |
|---|---|
| public | DefaultEntityResponse(HttpStatusCode statusCode, HttpHeaders headers, MultiValueMap<String, ResponseCookie> cookies, T entity, BodyInserter<T, ? super ServerHttpResponse> inserter, Map<String, Object> hints)
|
| Modifier and Type | Method and Description |
|---|---|
| public T | entity()
Implements org. Return the entity that makes up this response. |
| public BodyInserter | inserter()
Implements org. Return the |
| protected Mono | writeToInternal(ServerWebExchange exchange, ServerResponse.
Implements abstract org.
|
| entity | back to summary |
|---|---|
| private final T entity | |
| inserter | back to summary |
|---|---|
| private final BodyInserter<T, ? super ServerHttpResponse> inserter | |
| DefaultEntityResponse | back to summary |
|---|---|
| public DefaultEntityResponse(HttpStatusCode statusCode, HttpHeaders headers, MultiValueMap<String, ResponseCookie> cookies, T entity, BodyInserter<T, ? super ServerHttpResponse> inserter, Map<String, Object> hints) | |
| entity | back to summary |
|---|---|
| public T entity() Implements org. Doc from org. Return the entity that makes up this response.
| |
| inserter | back to summary |
|---|---|
| public BodyInserter Implements org. Doc from org. Return the
| |
| writeToInternal | back to summary |
|---|---|
| protected Mono Implements abstract org.
| |