@Override public <T2> T2 getEntity(GenericType<T2> genericType, Annotation[] ann) { return getEntity(genericType.getType(), genericType.getGenericType(), ann); }
/** As {@link #getEntity(Response, GenericType)} but fails if the response is an error of any sort. */ public static <T> T getEntityOnSuccess(Response response, GenericType<T> type) { failSomeErrors(response, type.getType(), false); return getEntity(response, type); }
/** * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader * * @param message * @param type * @param factory * @return * @throws UnknownMediaType * @throws UnmarshalException */ public static <T> T getEntity(ClientMessage message, GenericType<T> type, ResteasyProviderFactory factory) throws UnknownMediaType, UnmarshalException { return getEntity(message, type.getType(), type.getGenericType(), factory); }
public ClientRequest body(MediaType contentType, Object data, GenericType genericType) { return body(contentType, data, genericType.getType(), genericType .getGenericType(), null); }
@Override public <T2> T2 getEntity(GenericType<T2> genericType) { return getEntity(genericType.getType(), genericType.getGenericType()); }
@Override public <T2> T2 getEntity(GenericType<T2> genericType) { return getEntity(genericType.getType(), genericType.getGenericType()); }
@Override public <T2> T2 getEntity(GenericType<T2> genericType, Annotation[] ann) { return getEntity(genericType.getType(), genericType.getGenericType(), ann); }
public ClientRequest body(MediaType contentType, Object data, GenericType genericType) { return body(contentType, data, genericType.getType(), genericType .getGenericType(), null); }
/** * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader * * @param message * @param type * @param factory * @return * @throws UnknownMediaType * @throws UnmarshalException */ public static <T> T getEntity(ClientMessage message, GenericType<T> type, ResteasyProviderFactory factory) throws UnknownMediaType, UnmarshalException { return getEntity(message, type.getType(), type.getGenericType(), factory); }
/** * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader * * @param message * @param type * @param factory * @param <T> * @return * @throws UnknownMediaType * @throws UnmarshalException */ public static <T> T getEntity(Message message, GenericType<T> type, ResteasyProviderFactory factory) throws UnknownMediaType { return getEntity(message, type.getType(), type.getGenericType(), factory); }
/** * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader * * @param message * @param type * @param factory * @return * @throws UnknownMediaType * @throws UnmarshalException */ public static <T> T getEntity(ClientMessage message, GenericType<T> type, ResteasyProviderFactory factory) throws UnknownMediaType, UnmarshalException { return getEntity(message, type.getType(), type.getGenericType(), factory); }
/** * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader * * @param message * @param type * @param factory * @param <T> * @return * @throws UnknownMediaType * @throws UnmarshalException */ public static <T> T getEntity(Message message, GenericType<T> type, ResteasyProviderFactory factory) throws UnknownMediaType { return getEntity(message, type.getType(), type.getGenericType(), factory); }
/** * Extract an object using a built-in RESTEasy JAX-RS MessageBodyReader * * @param message * @param type * @param factory * @param <T> * @return * @throws UnknownMediaType * @throws UnmarshalException */ public static <T> T getEntity(Message message, GenericType<T> type, ResteasyProviderFactory factory) throws UnknownMediaType { return getEntity(message, type.getType(), type.getGenericType(), factory); }
/** As {@link #getEntity(Response, Class)} */ public static <T> T getEntity(Response response, GenericType<T> type) { if (response instanceof ClientResponse) { ClientResponse<?> clientResponse = (ClientResponse<?>) response; return clientResponse.getEntity(type); } else if (response instanceof BuiltResponse) { // Handle BuiltResponsePreservingError turning objects into Strings if (response.getEntity() instanceof String) { failSomeErrors(response, type.getType(), true); return new Gson().fromJson(response.getEntity().toString(), type.getGenericType()); } } // Last-gasp attempt. return type.getType().cast(response.getEntity()); }
public <T> ClientResponse<T> options(GenericType type) throws Exception { BaseClientResponse response = (BaseClientResponse) options(); response.setReturnType(type.getType()); response.setGenericReturnType(type.getGenericType()); return response; }
public <T> ClientResponse<T> delete(GenericType type) throws Exception { BaseClientResponse response = (BaseClientResponse) delete(); response.setReturnType(type.getType()); response.setGenericReturnType(type.getGenericType()); return response; }
public <T> ClientResponse<T> put(GenericType type) throws Exception { BaseClientResponse response = (BaseClientResponse) put(); response.setReturnType(type.getType()); response.setGenericReturnType(type.getGenericType()); return response; }
public <T> ClientResponse<T> post(GenericType type) throws Exception { BaseClientResponse response = (BaseClientResponse) post(); response.setReturnType(type.getType()); response.setGenericReturnType(type.getGenericType()); return response; }
public <T> ClientResponse<T> delete(GenericType type) throws Exception { BaseClientResponse response = (BaseClientResponse) delete(); response.setReturnType(type.getType()); response.setGenericReturnType(type.getGenericType()); return response; }
public <T> ClientResponse<T> get(GenericType type) throws Exception { BaseClientResponse response = (BaseClientResponse) get(); response.setReturnType(type.getType()); response.setGenericReturnType(type.getGenericType()); return response; }