org.springframework.web.reactive.function.server

Interface EntityResponse<T>

  • Type Parameters:
    T - the entity type
    All Superinterfaces:
    ServerResponse


    public interface EntityResponse<T>
    extends ServerResponse
    Entity-specific subtype of ServerResponse that exposes entity data.
    Since:
    5.0
    Author:
    Arjen Poutsma, Juergen Hoeller
    • Method Detail

      • entity

        T entity()
        Return the entity that makes up this response.
      • fromObject

        static <T> EntityResponse.Builder<T> fromObject(T t)
        Create a builder with the given object.
        Type Parameters:
        T - the type of the elements contained in the publisher
        Parameters:
        t - the object that represents the body of the response
        Returns:
        the created builder
      • fromPublisher

        static <T,P extends org.reactivestreams.Publisher<T>> EntityResponse.Builder<P> fromPublisher(P publisher,
                                                                                                      java.lang.Class<T> elementClass)
        Create a builder with the given publisher.
        Type Parameters:
        T - the type of the elements contained in the publisher
        P - the type of the Publisher
        Parameters:
        publisher - the publisher that represents the body of the response
        elementClass - the class of elements contained in the publisher
        Returns:
        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.
        Type Parameters:
        T - the type of the elements contained in the publisher
        P - the type of the Publisher
        Parameters:
        publisher - the publisher that represents the body of the response
        typeReference - the type of elements contained in the publisher
        Returns:
        the created builder