public static interface RenderingResponse.Builder
RenderingResponse
.Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<RenderingResponse> |
build()
Build the response.
|
RenderingResponse.Builder |
cookie(ResponseCookie cookie)
Add the given cookie to the response.
|
RenderingResponse.Builder |
cookies(Consumer<MultiValueMap<String,ResponseCookie>> cookiesConsumer)
Manipulate this response's cookies with the given consumer.
|
RenderingResponse.Builder |
header(String headerName,
String... headerValues)
Add the given header value(s) under the given name.
|
RenderingResponse.Builder |
headers(HttpHeaders headers)
Copy the given headers into the entity's headers map.
|
RenderingResponse.Builder |
modelAttribute(Object attribute)
Add the supplied attribute to the model using a
generated name.
|
RenderingResponse.Builder |
modelAttribute(String name,
Object value)
Add the supplied attribute value under the supplied name.
|
RenderingResponse.Builder |
modelAttributes(Collection<?> attributes)
Copy all attributes in the supplied
Collection into the model,
using attribute name generation for each element. |
RenderingResponse.Builder |
modelAttributes(Map<String,?> attributes)
Copy all attributes in the supplied
Map into the model. |
RenderingResponse.Builder |
modelAttributes(Object... attributes)
Copy all attributes in the supplied array into the model,
using attribute name generation for each element.
|
RenderingResponse.Builder |
status(HttpStatus status)
Set the HTTP status.
|
RenderingResponse.Builder |
status(int status)
Set the HTTP status.
|
RenderingResponse.Builder modelAttribute(Object attribute)
Collections
are not added to
the model when using this method because we cannot correctly determine
the true convention name. View code should check for null
rather
than for empty collections.
attribute
- the model attribute value (never null
)RenderingResponse.Builder modelAttribute(String name, @Nullable Object value)
name
- the name of the model attribute (never null
)value
- the model attribute value (can be null
)RenderingResponse.Builder modelAttributes(Object... attributes)
modelAttribute(Object)
RenderingResponse.Builder modelAttributes(Collection<?> attributes)
Collection
into the model,
using attribute name generation for each element.modelAttribute(Object)
RenderingResponse.Builder modelAttributes(Map<String,?> attributes)
Map
into the model.modelAttribute(String, Object)
RenderingResponse.Builder header(String headerName, String... headerValues)
headerName
- the header nameheaderValues
- the header value(s)HttpHeaders.add(String, String)
RenderingResponse.Builder headers(HttpHeaders headers)
headers
- the existing HttpHeaders to copy fromHttpHeaders.add(String, String)
RenderingResponse.Builder status(HttpStatus status)
status
- the response statusRenderingResponse.Builder status(int status)
status
- the response statusRenderingResponse.Builder cookie(ResponseCookie cookie)
cookie
- the cookie to addRenderingResponse.Builder cookies(Consumer<MultiValueMap<String,ResponseCookie>> cookiesConsumer)
MultiValueMap
methods.cookiesConsumer
- a function that consumes the cookiesreactor.core.publisher.Mono<RenderingResponse> build()