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

fromPublisher

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

Create a builder with the given publisher.

Parameters

publisher - the publisher that represents the body of the response

elementClass - the class of elements contained in the publisher

- the type of the elements contained in the publisher

- the type of the Publisher

Return
the created builder

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

Create a builder with the given publisher.

Parameters

publisher - the publisher that represents the body of the response

typeReference - the type of elements contained in the publisher

- the type of the elements contained in the publisher

- the type of the Publisher

Return
the created builder