Package org.springframework.http
Interface ResponseEntity.BodyBuilder
- All Superinterfaces:
ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>
- Enclosing class:
- ResponseEntity<T>
public static interface ResponseEntity.BodyBuilder
extends ResponseEntity.HeadersBuilder<ResponseEntity.BodyBuilder>
Defines a builder that adds a body to the response entity.
- Since:
- 4.1
-
Method Summary
Modifier and TypeMethodDescription<T> ResponseEntity<T>
body
(T body) Set the body of the response entity and returns it.contentLength
(long contentLength) Set the length of the body in bytes, as specified by theContent-Length
header.contentType
(MediaType contentType) Set the media type of the body, as specified by theContent-Type
header.Methods inherited from interface org.springframework.http.ResponseEntity.HeadersBuilder
allow, build, cacheControl, eTag, header, headers, headers, lastModified, lastModified, lastModified, location, varyBy
-
Method Details
-
contentLength
Set the length of the body in bytes, as specified by theContent-Length
header.- Parameters:
contentLength
- the content length- Returns:
- this builder
- See Also:
-
contentType
Set the media type of the body, as specified by theContent-Type
header.- Parameters:
contentType
- the content type- Returns:
- this builder
- See Also:
-
body
Set the body of the response entity and returns it.- Type Parameters:
T
- the type of the body- Parameters:
body
- the body of the response entity- Returns:
- the built response entity
-