/** * Get the entity of the response. * <p> * If the entity is not an instance of Closeable then this response * is closed (you cannot read it more than once, any subsequent * call will produce {@link ClientHandlerException}). * * @param <T> the type of the response. * @param gt the generic type of the entity. * @return an instance of the type represented by the generic type. * * @throws ClientHandlerException if there is an error processing the response. * @throws UniformInterfaceException if the response status is 204 (No Content). */ public <T> T getEntity(GenericType<T> gt) throws ClientHandlerException, UniformInterfaceException { return getEntity(gt.getRawClass(), gt.getType()); }
/** * Get the entity of the response. * <p> * If the entity is not an instance of Closeable then this response * is closed (you cannot read it more than once, any subsequent * call will produce {@link ClientHandlerException}). * * @param <T> the type of the response. * @param gt the generic type of the entity. * @return an instance of the type represented by the generic type. * * @throws ClientHandlerException if there is an error processing the response. * @throws UniformInterfaceException if the response status is 204 (No Content). */ public <T> T getEntity(GenericType<T> gt) throws ClientHandlerException, UniformInterfaceException { return getEntity(gt.getRawClass(), gt.getType()); }