spring-framework / org.springframework.web.reactive.function.server / EntityResponse

EntityResponse

interface EntityResponse<T : Any> : ServerResponse

Entity-specific subtype of ServerResponse that exposes entity data.

Author
Arjen Poutsma

Since
5.0

Functions

entity

abstract fun entity(): T

Return the entity that makes up this response.

fromObject

open static fun <T : Any> fromObject(t: T): Builder

Create a builder with the given object.

fromPublisher

open static fun <T : Any, P : Publisher<T>> fromPublisher(publisher: P, elementClass: Class<T>): Builder
open static fun <T : Any, P : Publisher<T>> fromPublisher(publisher: P, typeReference: ParameterizedTypeReference<T>): Builder

Create a builder with the given publisher.

inserter

abstract fun inserter(): BodyInserter<T, in ServerHttpResponse>

Return the BodyInserter that writes the entity to the output stream.