private static final class DefaultEntityResponseBuilder.DefaultEntityResponse<T> extends DefaultServerResponseBuilder.AbstractServerResponse implements EntityResponse<T>
EntityResponse.Builder<T>
ServerResponse.BodyBuilder, ServerResponse.Context, ServerResponse.HeadersBuilder<B extends ServerResponse.HeadersBuilder<B>>
Modifier and Type | Field and Description |
---|---|
private T |
entity |
private java.util.Map<java.lang.String,java.lang.Object> |
hints |
private BodyInserter<T,? super ServerHttpResponse> |
inserter |
Constructor and Description |
---|
DefaultEntityResponse(HttpStatus statusCode,
HttpHeaders headers,
T entity,
BodyInserter<T,? super ServerHttpResponse> inserter,
java.util.Map<java.lang.String,java.lang.Object> hints) |
Modifier and Type | Method and Description |
---|---|
T |
entity()
Return the entity that makes up this response.
|
BodyInserter<T,? super ServerHttpResponse> |
inserter()
Return the
BodyInserter that writes the entity to the output stream. |
<any> |
writeTo(ServerWebExchange exchange,
ServerResponse.Context context)
Write this response to the given web exchange.
|
headers, statusCode, writeStatusAndHeaders
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromObject, fromPublisher, fromPublisher
accepted, badRequest, created, from, headers, noContent, notFound, ok, permanentRedirect, seeOther, status, statusCode, temporaryRedirect, unprocessableEntity
private final T entity
private final BodyInserter<T,? super ServerHttpResponse> inserter
private final java.util.Map<java.lang.String,java.lang.Object> hints
public DefaultEntityResponse(HttpStatus statusCode, HttpHeaders headers, T entity, BodyInserter<T,? super ServerHttpResponse> inserter, java.util.Map<java.lang.String,java.lang.Object> hints)
public T entity()
EntityResponse
entity
in interface EntityResponse<T>
public BodyInserter<T,? super ServerHttpResponse> inserter()
EntityResponse
BodyInserter
that writes the entity to the output stream.inserter
in interface EntityResponse<T>
public <any> writeTo(ServerWebExchange exchange, ServerResponse.Context context)
ServerResponse
writeTo
in interface ServerResponse
exchange
- the web exchange to write tocontext
- the context to use when writingMono<Void>
to indicate when writing is complete