Interface RenderingResponse.Builder
- Enclosing interface:
- RenderingResponse
public static interface RenderingResponse.Builder
Defines a builder for
RenderingResponse
.-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<RenderingResponse>
build()
Build the response.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.Add the given header value(s) under the given name.headers
(HttpHeaders headers) Copy the given headers into the entity's headers map.modelAttribute
(Object attribute) Add the supplied attribute to the model using a generated name.modelAttribute
(String name, Object value) Add the supplied attribute value under the supplied name.modelAttributes
(Object... attributes) Copy all attributes in the supplied array into the model, using attribute name generation for each element.modelAttributes
(Collection<?> attributes) Copy all attributes in the suppliedCollection
into the model, using attribute name generation for each element.modelAttributes
(Map<String, ?> attributes) Copy all attributes in the suppliedMap
into the model.status
(int status) Set the HTTP status.status
(HttpStatus status) Set the HTTP status.
-
Method Details
-
modelAttribute
Add the supplied attribute to the model using a generated name.Note: Empty
Collections
are not added to the model when using this method because we cannot correctly determine the true convention name. View code should check fornull
rather than for empty collections.- Parameters:
attribute
- the model attribute value (nevernull
)
-
modelAttribute
Add the supplied attribute value under the supplied name.- Parameters:
name
- the name of the model attribute (nevernull
)value
- the model attribute value (can benull
)
-
modelAttributes
Copy all attributes in the supplied array into the model, using attribute name generation for each element.- See Also:
-
modelAttributes
Copy all attributes in the suppliedCollection
into the model, using attribute name generation for each element.- See Also:
-
modelAttributes
Copy all attributes in the suppliedMap
into the model.- See Also:
-
header
Add the given header value(s) under the given name.- Parameters:
headerName
- the header nameheaderValues
- the header value(s)- Returns:
- this builder
- See Also:
-
headers
Copy the given headers into the entity's headers map.- Parameters:
headers
- the existing HttpHeaders to copy from- Returns:
- this builder
- See Also:
-
status
Set the HTTP status.- Parameters:
status
- the response status- Returns:
- this builder
-
status
Set the HTTP status.- Parameters:
status
- the response status- Returns:
- this builder
- Since:
- 5.0.3
-
cookie
Add the given cookie to the response.- Parameters:
cookie
- the cookie to add- Returns:
- this builder
-
cookies
Manipulate 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 otherMultiValueMap
methods.- Parameters:
cookiesConsumer
- a function that consumes the cookies- Returns:
- this builder
-
build
reactor.core.publisher.Mono<RenderingResponse> build()Build the response.- Returns:
- the built response
-