Top Description Inners Fields Constructors Methods
org.springframework.web.servlet.function

pack-priv final Class DefaultEntityResponseBuilder<T>

extends Object
implements EntityResponse.Builder<T>
Class Inheritance
All Implemented Interfaces
org.springframework.web.servlet.function.EntityResponse.Builder
Type Parameters
<T>
the entity type
Imports
java.io.IOException, java.lang.reflect.Type, java.net.URI, java.time.Instant, .ZonedDateTime, java.util.Arrays, .LinkedHashSet, .List, .Set, java.util.concurrent.CompletionException, .CompletionStage, java.util.function.Consumer, jakarta.servlet.ServletException, jakarta.servlet.http.Cookie, .HttpServletRequest, .HttpServletResponse, .HttpServletResponseWrapper, org.reactivestreams.Publisher, .Subscriber, .Subscription, org.springframework.core.ParameterizedTypeReference, .ReactiveAdapter, .ReactiveAdapterRegistry, org.springframework.core.io.InputStreamResource, .Resource, org.springframework.core.io.support.ResourceRegion, org.springframework.http.CacheControl, .HttpHeaders, .HttpMethod, .HttpRange, .HttpStatus, .HttpStatusCode, .InvalidMediaTypeException, .MediaType, org.springframework.http.converter.GenericHttpMessageConverter, .HttpMessageConverter, org.springframework.http.server.ServletServerHttpResponse, org.springframework.lang.Nullable, org.springframework.util.Assert, .LinkedMultiValueMap, .MultiValueMap, org.springframework.web.HttpMediaTypeNotAcceptableException, org.springframework.web.context.request.async.DeferredResult, org.springframework.web.servlet.ModelAndView

Default EntityResponse.Builder implementation.
Author
Arjen Poutsma
Since
5.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
DefaultEntityResponseBuilder.DefaultEntityResponse<T>

Default EntityResponse implementation for synchronous bodies.

private static class

Field Summary

Modifier and TypeField and Description
private final MultiValueMap<String, Cookie>
private final T
private final Type
private final HttpHeaders
private static final Type
private HttpStatusCode

Constructor Summary

AccessConstructor and Description
private
DefaultEntityResponseBuilder(T entity, Type entityType)

Method Summary

Modifier and TypeMethod and Description
public EntityResponse.Builder<T>
allow(HttpMethod...
the allowed methods
allowedMethods
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.allow.

Set the set of allowed HTTP methods, as specified by the Allow header.

public EntityResponse.Builder<T>
allow(Set<HttpMethod>
the allowed methods
allowedMethods
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.allow.

Set the set of allowed HTTP methods, as specified by the Allow header.

public EntityResponse<T>
public EntityResponse.Builder<T>
cacheControl(CacheControl
a builder for cache-related HTTP response headers
cacheControl
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.cacheControl.

Set the caching directives for the resource, as specified by the HTTP 1.1 Cache-Control header.

public EntityResponse.Builder<T>
contentLength(long
the content length
contentLength
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.contentLength.

Set the length of the body in bytes, as specified by the Content-Length header.

public EntityResponse.Builder<T>
contentType(MediaType
the content type
contentType
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.contentType.

Set the media type of the body, as specified by the Content-Type header.

public EntityResponse.Builder<T>
cookies(Consumer<MultiValueMap<String, Cookie>>
a function that consumes the cookies
cookiesConsumer
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.cookies.

Manipulate this response's cookies with the given consumer.

public EntityResponse.Builder<T>
eTag(String
the new entity tag
etag
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.eTag.

Set the entity tag of the body, as specified by the ETag header.

public static <T> EntityResponse.Builder<T>
fromObject(T t)

Return a new EntityResponse.Builder from the given object.

public static <T> EntityResponse.Builder<T>
fromObject(T t, ParameterizedTypeReference<?> bodyType)

Return a new EntityResponse.Builder from the given object and type reference.

public EntityResponse.Builder<T>
header(String
the header name
headerName
,
String...
the header value(s)
headerValues
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.header.

Add the given header value(s) under the given name.

public EntityResponse.Builder<T>
headers(Consumer<HttpHeaders>
a function that consumes the HttpHeaders
headersConsumer
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.headers.

Manipulate this response's headers with the given consumer.

public EntityResponse.Builder<T>
lastModified(ZonedDateTime
the last modified date
lastModified
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.lastModified.

Set the time the resource was last changed, as specified by the Last-Modified header.

public EntityResponse.Builder<T>
lastModified(Instant
the last modified date
lastModified
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.lastModified.

Set the time the resource was last changed, as specified by the Last-Modified header.

public EntityResponse.Builder<T>
location(URI
the location
location
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.location.

Set the location of a resource, as specified by the Location header.

public EntityResponse.Builder<T>
status(HttpStatusCode
the response status
status
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.status.

Set the HTTP status.

public EntityResponse.Builder<T>
status(int
the response status
status
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.status.

Set the HTTP status.

public EntityResponse.Builder<T>
varyBy(String...
request header names
requestHeaders
)

Implements org.springframework.web.servlet.function.EntityResponse.Builder.varyBy.

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait