public interface EntityResponse<T> extends ServerResponse
ServerResponse
that exposes entity data.Modifier and Type | Interface and Description |
---|---|
static interface |
EntityResponse.Builder<T>
Defines a builder for
EntityResponse . |
ServerResponse.BodyBuilder, ServerResponse.HeadersBuilder<B extends ServerResponse.HeadersBuilder<B>>
Modifier and Type | Method and Description |
---|---|
T |
entity()
Return the entity that makes up this response.
|
static <T> EntityResponse.Builder<T> |
fromObject(T t)
Create a builder with the given object.
|
static <T,P extends <any>> |
fromPublisher(P publisher,
java.lang.Class<T> elementClass)
Create a builder with the given publisher.
|
static <T,P extends <any>> |
fromPublisher(P publisher,
ResolvableType elementType)
Create a builder with the given publisher.
|
BodyInserter<T,? super ServerHttpResponse> |
inserter()
Return the
BodyInserter that writes the entity to the output stream. |
accepted, badRequest, created, from, headers, noContent, notFound, ok, status, statusCode, unprocessableEntity, writeTo
T entity()
BodyInserter<T,? super ServerHttpResponse> inserter()
BodyInserter
that writes the entity to the output stream.static <T> EntityResponse.Builder<T> fromObject(T t)
T
- the type of the elements contained in the publishert
- the object that represents the body of the responsestatic <T,P extends <any>> EntityResponse.Builder<P> fromPublisher(P publisher, java.lang.Class<T> elementClass)
T
- the type of the elements contained in the publisherP
- the type of the Publisher
publisher
- the publisher that represents the body of the responseelementClass
- the class of elements contained in the publisherstatic <T,P extends <any>> EntityResponse.Builder<P> fromPublisher(P publisher, ResolvableType elementType)
T
- the type of the elements contained in the publisherP
- the type of the Publisher
publisher
- the publisher that represents the body of the responseelementType
- the type of elements contained in the publisher