接口 EntityResponse<T>
- 类型参数:
T
- the entity type
- 所有超级接口:
ServerResponse
public interface EntityResponse<T> extends ServerResponse
Entity-specific subtype ofServerResponse
that exposes entity data.- 从以下版本开始:
- 5.0
- 作者:
- Arjen Poutsma, Juergen Hoeller
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static interface
EntityResponse.Builder<T>
Defines a builder forEntityResponse
.从接口继承的嵌套类/接口 org.springframework.web.reactive.function.server.ServerResponse
ServerResponse.BodyBuilder, ServerResponse.Context, ServerResponse.HeadersBuilder<B extends ServerResponse.HeadersBuilder<B>>
方法概要
所有方法 静态方法 实例方法 抽象方法 修饰符和类型 方法 说明 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>>
EntityResponse.Builder<P>fromPublisher(P publisher, Class<T> elementClass)
Create a builder with the given publisher.static <T,P extends org.reactivestreams.Publisher<T>>
EntityResponse.Builder<P>fromPublisher(P publisher, ParameterizedTypeReference<T> typeReference)
Create a builder with the given publisher.BodyInserter<T,? super ServerHttpResponse>
inserter()
Return theBodyInserter
that writes the entity to the output stream.从接口继承的方法 org.springframework.web.reactive.function.server.ServerResponse
cookies, headers, rawStatusCode, statusCode, writeTo
方法详细资料
inserter
BodyInserter<T,? super ServerHttpResponse> inserter()
Return theBodyInserter
that writes the entity to the output stream.
fromObject
static <T> EntityResponse.Builder<T> fromObject(T body)
Create a builder with the given object.- 类型参数:
T
- the type of the body- 参数:
body
- the object that represents the body of the response- 返回:
- the created builder
fromProducer
static <T> EntityResponse.Builder<T> fromProducer(T producer, Class<?> elementClass)
Create a builder with the given producer.- 参数:
producer
- the producer that represents the body of the responseelementClass
- the class of elements contained in the publisher- 返回:
- the created builder
- 从以下版本开始:
- 5.2
fromProducer
static <T> EntityResponse.Builder<T> fromProducer(T producer, ParameterizedTypeReference<?> typeReference)
Create a builder with the given producer.- 参数:
producer
- the producer that represents the body of the responsetypeReference
- the type of elements contained in the producer- 返回:
- the created builder
- 从以下版本开始:
- 5.2
fromPublisher
static <T,P extends org.reactivestreams.Publisher<T>> EntityResponse.Builder<P> fromPublisher(P publisher, Class<T> elementClass)
Create a builder with the given publisher.- 类型参数:
T
- the type of the elements contained in the publisherP
- the type of thePublisher
- 参数:
publisher
- the publisher that represents the body of the responseelementClass
- the class of elements contained in the publisher- 返回:
- the created builder
fromPublisher
static <T,P extends org.reactivestreams.Publisher<T>> EntityResponse.Builder<P> fromPublisher(P publisher, ParameterizedTypeReference<T> typeReference)
Create a builder with the given publisher.- 类型参数:
T
- the type of the elements contained in the publisherP
- the type of thePublisher
- 参数:
publisher
- the publisher that represents the body of the responsetypeReference
- the type of elements contained in the publisher- 返回:
- the created builder