public static interface EntityResponse.Builder<T>
EntityResponse
.Modifier and Type | Method and Description |
---|---|
EntityResponse.Builder<T> |
allow(HttpMethod... allowedMethods)
Set the set of allowed
HTTP methods , as specified
by the Allow header. |
EntityResponse.Builder<T> |
allow(java.util.Set<HttpMethod> allowedMethods)
Set the set of allowed
HTTP methods , as specified
by the Allow header. |
reactor.core.publisher.Mono<EntityResponse<T>> |
build()
Build the response.
|
EntityResponse.Builder<T> |
cacheControl(CacheControl cacheControl)
Set the caching directives for the resource, as specified by the HTTP 1.1
Cache-Control header. |
EntityResponse.Builder<T> |
contentLength(long contentLength)
Set the length of the body in bytes, as specified by the
Content-Length header. |
EntityResponse.Builder<T> |
contentType(MediaType contentType)
Set the media type of the body, as specified by the
Content-Type header. |
EntityResponse.Builder<T> |
eTag(java.lang.String eTag)
Set the entity tag of the body, as specified by the
ETag header. |
EntityResponse.Builder<T> |
header(java.lang.String headerName,
java.lang.String... headerValues)
Add the given header value(s) under the given name.
|
EntityResponse.Builder<T> |
headers(HttpHeaders headers)
Copy the given headers into the entity's headers map.
|
EntityResponse.Builder<T> |
hint(java.lang.String key,
java.lang.Object value)
Add a serialization hint like
Jackson2CodecSupport.JSON_VIEW_HINT to
customize how the body will be serialized. |
EntityResponse.Builder<T> |
lastModified(java.time.ZonedDateTime lastModified)
Set the time the resource was last changed, as specified by the
Last-Modified header. |
EntityResponse.Builder<T> |
location(java.net.URI location)
Set the location of a resource, as specified by the
Location header. |
EntityResponse.Builder<T> |
status(HttpStatus status)
Set the status.
|
EntityResponse.Builder<T> |
varyBy(java.lang.String... requestHeaders)
Configure one or more request header names (e.g.
|
EntityResponse.Builder<T> header(java.lang.String headerName, java.lang.String... headerValues)
headerName
- the header nameheaderValues
- the header value(s)HttpHeaders.add(String, String)
EntityResponse.Builder<T> headers(HttpHeaders headers)
headers
- the existing HttpHeaders to copy fromHttpHeaders.add(String, String)
EntityResponse.Builder<T> status(HttpStatus status)
status
- the response statusEntityResponse.Builder<T> allow(HttpMethod... allowedMethods)
HTTP methods
, as specified
by the Allow
header.allowedMethods
- the allowed methodsHttpHeaders.setAllow(Set)
EntityResponse.Builder<T> allow(java.util.Set<HttpMethod> allowedMethods)
HTTP methods
, as specified
by the Allow
header.allowedMethods
- the allowed methodsHttpHeaders.setAllow(Set)
EntityResponse.Builder<T> eTag(java.lang.String eTag)
ETag
header.eTag
- the new entity tagHttpHeaders.setETag(String)
EntityResponse.Builder<T> lastModified(java.time.ZonedDateTime lastModified)
Last-Modified
header.
The date should be specified as the number of milliseconds since January 1, 1970 GMT.
lastModified
- the last modified dateHttpHeaders.setLastModified(long)
EntityResponse.Builder<T> location(java.net.URI location)
Location
header.location
- the locationHttpHeaders.setLocation(URI)
EntityResponse.Builder<T> cacheControl(CacheControl cacheControl)
Cache-Control
header.
A CacheControl
instance can be built like
CacheControl.maxAge(3600).cachePublic().noTransform()
.
cacheControl
- a builder for cache-related HTTP response headersEntityResponse.Builder<T> varyBy(java.lang.String... requestHeaders)
requestHeaders
- request header namesEntityResponse.Builder<T> contentLength(long contentLength)
Content-Length
header.contentLength
- the content lengthHttpHeaders.setContentLength(long)
EntityResponse.Builder<T> contentType(MediaType contentType)
Content-Type
header.contentType
- the content typeHttpHeaders.setContentType(MediaType)
EntityResponse.Builder<T> hint(java.lang.String key, java.lang.Object value)
Jackson2CodecSupport.JSON_VIEW_HINT
to
customize how the body will be serialized.key
- the hint keyvalue
- the hint valuereactor.core.publisher.Mono<EntityResponse<T>> build()