T - the entity typepublic 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.Context, 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 body)Create a builder with the given object. | 
| static <T> EntityResponse.Builder<T> | fromProducer(T producer,
            Class<?> elementClass)Create a builder with the given producer. | 
| static <T> EntityResponse.Builder<T> | fromProducer(T producer,
            ParameterizedTypeReference<?> typeReference)Create a builder with the given producer. | 
| static <T,P extends org.reactivestreams.Publisher<T>> | fromPublisher(P publisher,
             Class<T> elementClass)Create a builder with the given publisher. | 
| static <T,P extends org.reactivestreams.Publisher<T>> | fromPublisher(P publisher,
             ParameterizedTypeReference<T> typeReference)Create a builder with the given publisher. | 
| BodyInserter<T,? super ServerHttpResponse> | inserter()Return the  BodyInserterthat writes the entity to the output stream. | 
accepted, badRequest, cookies, created, from, headers, noContent, notFound, ok, permanentRedirect, rawStatusCode, seeOther, status, status, statusCode, temporaryRedirect, unprocessableEntity, writeToT entity()
BodyInserter<T,? super ServerHttpResponse> inserter()
BodyInserter that writes the entity to the output stream.static <T> EntityResponse.Builder<T> fromObject(T body)
T - the type of the bodybody - the object that represents the body of the responsestatic <T> EntityResponse.Builder<T> fromProducer(T producer, Class<?> elementClass)
producer - the producer that represents the body of the responseelementClass - the class of elements contained in the publisherstatic <T> EntityResponse.Builder<T> fromProducer(T producer, ParameterizedTypeReference<?> typeReference)
producer - the producer that represents the body of the responsetypeReference - the type of elements contained in the producerstatic <T,P extends org.reactivestreams.Publisher<T>> EntityResponse.Builder<P> fromPublisher(P publisher, Class<T> elementClass)
T - the type of the elements contained in the publisherP - the type of the Publisherpublisher - the publisher that represents the body of the responseelementClass - the class of elements contained in the publisherstatic <T,P extends org.reactivestreams.Publisher<T>> EntityResponse.Builder<P> fromPublisher(P publisher, ParameterizedTypeReference<T> typeReference)
T - the type of the elements contained in the publisherP - the type of the Publisherpublisher - the publisher that represents the body of the responsetypeReference - the type of elements contained in the publisher