类 ResponseEntity.DefaultBuilder
java.lang.Object
cn.taketoday.http.ResponseEntity.DefaultBuilder
- 封闭类:
- ResponseEntity<T>
private static class ResponseEntity.DefaultBuilder
extends Object
implements ResponseEntity.BodyBuilder
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明allow(HttpMethod... allowedMethods) Set the set of allowedHTTP methods, as specified by theAllowheader.<T> ResponseEntity<T>body(T body) Set the body of the response entity and returns it.<T> ResponseEntity<T>build()Build the response entity with no body.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.Set the entity tag of the body, as specified by theETagheader.Add the given, single header value under the given name.headers(HttpHeaders headers) Copy the given headers into the entity's headers map.headers(Consumer<HttpHeaders> headersConsumer) Manipulate this entity's headers with the given consumer.lastModified(long date) Set the time the resource was last changed, as specified by theLast-Modifiedheader.lastModified(Instant date) Set the time the resource was last changed, as specified by theLast-Modifiedheader.lastModified(ZonedDateTime date) Set the time the resource was last changed, as specified by theLast-Modifiedheader.Set the location of a resource, as specified by theLocationheader.Configure one or more request header names (e.g.
-
字段详细资料
-
statusCode
-
headers
-
-
构造器详细资料
-
DefaultBuilder
-
-
方法详细资料
-
header
从接口复制的说明:ResponseEntity.HeadersBuilderAdd the given, single header value under the given name.- 指定者:
header在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
headerName- the header nameheaderValues- the header value(s)- 返回:
- this builder
- 另请参阅:
-
headers
从接口复制的说明:ResponseEntity.HeadersBuilderCopy the given headers into the entity's headers map.- 指定者:
headers在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
headers- the existing HttpHeaders to copy from- 返回:
- this builder
- 另请参阅:
-
headers
从接口复制的说明:ResponseEntity.HeadersBuilderManipulate 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.- 指定者:
headers在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
headersConsumer- a function that consumes theHttpHeaders- 返回:
- this builder
-
allow
从接口复制的说明:ResponseEntity.HeadersBuilderSet the set of allowedHTTP methods, as specified by theAllowheader.- 指定者:
allow在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
allowedMethods- the allowed methods- 返回:
- this builder
- 另请参阅:
-
contentLength
从接口复制的说明:ResponseEntity.BodyBuilderSet the length of the body in bytes, as specified by theContent-Lengthheader.- 指定者:
contentLength在接口中ResponseEntity.BodyBuilder- 参数:
contentLength- the content length- 返回:
- this builder
- 另请参阅:
-
contentType
从接口复制的说明:ResponseEntity.BodyBuilderSet the media type of the body, as specified by theContent-Typeheader.- 指定者:
contentType在接口中ResponseEntity.BodyBuilder- 参数:
contentType- the content type- 返回:
- this builder
- 另请参阅:
-
eTag
从接口复制的说明:ResponseEntity.HeadersBuilderSet the entity tag of the body, as specified by theETagheader.- 指定者:
eTag在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
etag- the new entity tag- 返回:
- this builder
- 另请参阅:
-
lastModified
从接口复制的说明:ResponseEntity.HeadersBuilderSet the time the resource was last changed, as specified by theLast-Modifiedheader.- 指定者:
lastModified在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
date- the last modified date- 返回:
- this builder
- 另请参阅:
-
lastModified
从接口复制的说明:ResponseEntity.HeadersBuilderSet the time the resource was last changed, as specified by theLast-Modifiedheader.- 指定者:
lastModified在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
date- the last modified date- 返回:
- this builder
- 另请参阅:
-
lastModified
从接口复制的说明:ResponseEntity.HeadersBuilderSet 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.
- 指定者:
lastModified在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
date- the last modified date- 返回:
- this builder
- 另请参阅:
-
location
从接口复制的说明:ResponseEntity.HeadersBuilderSet the location of a resource, as specified by theLocationheader.- 指定者:
location在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
location- the location- 返回:
- this builder
- 另请参阅:
-
cacheControl
从接口复制的说明:ResponseEntity.HeadersBuilderSet the caching directives for the resource, as specified by the HTTP 1.1Cache-Controlheader.A
CacheControlinstance can be built likeCacheControl.maxAge(3600).cachePublic().noTransform().- 指定者:
cacheControl在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
cacheControl- a builder for cache-related HTTP response headers- 返回:
- this builder
- 另请参阅:
-
varyBy
从接口复制的说明:ResponseEntity.HeadersBuilderConfigure 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.- 指定者:
varyBy在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 参数:
requestHeaders- request header names
-
build
从接口复制的说明:ResponseEntity.HeadersBuilderBuild the response entity with no body.- 指定者:
build在接口中ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>- 返回:
- the response entity
- 另请参阅:
-
body
从接口复制的说明:ResponseEntity.BodyBuilderSet the body of the response entity and returns it.- 指定者:
body在接口中ResponseEntity.BodyBuilder- 类型参数:
T- the type of the body- 参数:
body- the body of the response entity- 返回:
- the built response entity
-