Interface EntityResponse.Builder<T>
- Type Parameters:
- T- a self reference to the builder type
- Enclosing interface:
- EntityResponse<T>
public static interface EntityResponse.Builder<T>
Defines a builder for 
EntityResponse.- 
Method SummaryModifier and TypeMethodDescriptionallow(Set<HttpMethod> allowedMethods) Set the set of allowedHTTP methods, as specified by theAllowheader.allow(HttpMethod... allowedMethods) Set the set of allowedHTTP methods, as specified by theAllowheader.reactor.core.publisher.Mono<EntityResponse<T>>build()Build the response.cacheControl(CacheControl cacheControl) Set the caching directives for the resource, as specified by the HTTP 1.1Cache-Controlheader.contentLength(long contentLength) Set the length of the body in bytes, as specified by theContent-Lengthheader.contentType(MediaType contentType) Set the media type of the body, as specified by theContent-Typeheader.cookie(ResponseCookie cookie) Add the given cookie to the response.cookies(Consumer<MultiValueMap<String, ResponseCookie>> cookiesConsumer) Manipulate this response's cookies with the given consumer.Set the entity tag of the body, as specified by theETagheader.Add the given header value(s) under the given name.headers(Consumer<HttpHeaders> headersConsumer) Manipulate this entity's headers with the given consumer.headers(HttpHeaders headers) Copy the given headers into the entity's headers map.Add a serialization hint likeJackson2CodecSupport.JSON_VIEW_HINTto customize how the body will be serialized.Customize the serialization hints with the given consumer.lastModified(Instant lastModified) Set the time the resource was last changed, as specified by theLast-Modifiedheader.lastModified(ZonedDateTime lastModified) Set the time the resource was last changed, as specified by theLast-Modifiedheader.Set the location of a resource, as specified by theLocationheader.status(int status) Set the HTTP status.status(HttpStatusCode status) Set the HTTP status.Configure one or more request header names (e.g.
- 
Method Details- 
headerAdd the given header value(s) under the given name.- Parameters:
- headerName- the header name
- headerValues- the header value(s)
- Returns:
- this builder
- See Also:
 
- 
headersCopy the given headers into the entity's headers map.- Parameters:
- headers- the existing HttpHeaders to copy from
- Returns:
- this builder
- See Also:
 
- 
headersManipulate 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 otherHttpHeadersmethods.- Parameters:
- headersConsumer- a function that consumes the- HttpHeaders
- Returns:
- this builder
- Since:
- 6.1
 
- 
statusSet the HTTP status.- Parameters:
- status- the response status
- Returns:
- this builder
 
- 
statusSet the HTTP status.- Parameters:
- status- the response status
- Returns:
- this builder
- Since:
- 5.0.3
 
- 
cookieAdd the given cookie to the response.- Parameters:
- cookie- the cookie to add
- Returns:
- this builder
 
- 
cookiesManipulate 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 otherMultiValueMapmethods.- Parameters:
- cookiesConsumer- a function that consumes the cookies
- Returns:
- this builder
 
- 
allowSet the set of allowedHTTP methods, as specified by theAllowheader.- Parameters:
- allowedMethods- the allowed methods
- Returns:
- this builder
- See Also:
 
- 
allowSet the set of allowedHTTP methods, as specified by theAllowheader.- Parameters:
- allowedMethods- the allowed methods
- Returns:
- this builder
- See Also:
 
- 
eTagSet the entity tag of the body, as specified by theETagheader.- Parameters:
- etag- the new entity tag
- Returns:
- this builder
- See Also:
 
- 
lastModifiedSet the time the resource was last changed, as specified by theLast-Modifiedheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT. - Parameters:
- lastModified- the last modified date
- Returns:
- this builder
- See Also:
 
- 
lastModifiedSet the time the resource was last changed, as specified by theLast-Modifiedheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT. - Parameters:
- lastModified- the last modified date
- Returns:
- this builder
- Since:
- 5.1.4
- See Also:
 
- 
locationSet the location of a resource, as specified by theLocationheader.- Parameters:
- location- the location
- Returns:
- this builder
- See Also:
 
- 
cacheControlSet the caching directives for the resource, as specified by the HTTP 1.1Cache-Controlheader.A CacheControlinstance can be built likeCacheControl.maxAge(3600).cachePublic().noTransform().- Parameters:
- cacheControl- a builder for cache-related HTTP response headers
- Returns:
- this builder
- See Also:
 
- 
varyByConfigure 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.- Parameters:
- requestHeaders- request header names
- Returns:
- this builder
 
- 
contentLengthSet the length of the body in bytes, as specified by theContent-Lengthheader.- Parameters:
- contentLength- the content length
- Returns:
- this builder
- See Also:
 
- 
contentTypeSet the media type of the body, as specified by theContent-Typeheader.- Parameters:
- contentType- the content type
- Returns:
- this builder
- See Also:
 
- 
hintAdd a serialization hint likeJackson2CodecSupport.JSON_VIEW_HINTto customize how the body will be serialized.- Parameters:
- key- the hint key
- value- the hint value
 
- 
hintsCustomize the serialization hints with the given consumer.- Parameters:
- hintsConsumer- a function that consumes the hints
- Returns:
- this builder
- Since:
- 5.1.6
 
- 
buildreactor.core.publisher.Mono<EntityResponse<T>> build()Build the response.- Returns:
- the built response
 
 
-