接口 EntityResponse<T>

类型参数:
T - the entity type
所有超级接口:
ServerResponse
所有已知实现类:
DefaultEntityResponseBuilder.CompletionStageEntityResponse, DefaultEntityResponseBuilder.DefaultEntityResponse, DefaultEntityResponseBuilder.PublisherEntityResponse

public interface EntityResponse<T> extends ServerResponse
Entity-specific subtype of ServerResponse that exposes entity data.
从以下版本开始:
4.0
作者:
Arjen Poutsma, Harry Yang
  • 方法详细资料

    • 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.
      类型参数:
      T - the type of element contained in the entity
      参数:
      t - the object that represents the body of the response
      返回:
      the created builder
    • fromObject

      static <T> EntityResponse.Builder<T> fromObject(T t, cn.taketoday.core.ParameterizedTypeReference<T> entityType)
      Create a builder with the given object and type reference.
      类型参数:
      T - the type of element contained in the entity
      参数:
      t - the object that represents the body of the response
      entityType - the type of the entity, used to capture the generic type
      返回:
      the created builder