org.springframework.web.servlet.function

## 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.2
  Author:
    Arjen Poutsma

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `EntityResponse.Builder<T>` Defines a builder for `EntityResponse`.

    - ### Nested classes/interfaces inherited from interface org.springframework.web.servlet.function.ServerResponse

      `ServerResponse.BodyBuilder, ServerResponse.Context, ServerResponse.HeadersBuilder<B extends ServerResponse.HeadersBuilder<B>>, ServerResponse.SseBuilder`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `entity()` Return the entity that makes up this response.
    `static <T> EntityResponse.Builder<T>` | `fromObject(T t)` Create a builder with the given object.
    `static <T> EntityResponse.Builder<T>` | `fromObject(T t, ParameterizedTypeReference<T> entityType)` Create a builder with the given object and type reference.

    - ### Methods inherited from interface org.springframework.web.servlet.function.ServerResponse

      `accepted, async, async, badRequest, cookies, created, from, headers, noContent, notFound, ok, permanentRedirect, rawStatusCode, seeOther, sse, sse, status, status, statusCode, temporaryRedirect, unprocessableEntity, writeTo`

- - ### 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 element contained in the entity
      Parameters:
        `t` - the object that represents the body of the response
      Returns:
        the created builder

    - #### fromObject

          static <T> EntityResponse.Builder<T> fromObject(T t,
                                                          ParameterizedTypeReference<T> entityType)

      Create a builder with the given object and type reference.
      Type Parameters:
        `T` - the type of element contained in the entity
      Parameters:
        `t` - the object that represents the body of the response
        `entityType` - the type of the entity, used to capture the generic type
      Returns:
        the created builder