@Override public void setEntity(Object entity) { if (entity instanceof Entity) { invocation.setEntity((Entity)entity); } else { invocation.setEntityObject(entity); } }
@SuppressWarnings("unchecked") @Override public void process(ClientInvocation invocation, Object param) { invocation.setEntity(Entity.entity(param == null? null : new GenericEntity<Object>(param, genericType), mediaType, annotations)); }
@Override public Invocation build(String method, Entity<?> entity) { invocation.setMethod(method); invocation.setEntity(entity); return createClientInvocation(this.invocation); }
@Override public <T> Future<T> method(String name, InvocationCallback<T> callback) { invocation.setMethod(name); invocation.setEntity(null); return invocation.submit(callback); }
@Override public Future<Response> method(String name) { invocation.setMethod(name); invocation.setEntity(null); return invocation.submit(); }
@Override public <T> Future<T> method(String name, GenericType<T> responseType) { invocation.setMethod(name); invocation.setEntity(null); return invocation.submit(responseType); }
@Override public <T> Future<T> method(String name, Class<T> responseType) { invocation.setMethod(name); invocation.setEntity(null); return invocation.submit(responseType); }
@Override public Future<Response> method(String name, Entity<?> entity) { invocation.setMethod(name); invocation.setEntity(entity); return invocation.submit(); }
@Override public <T> Future<T> method(String name, Entity<?> entity, Class<T> responseType) { invocation.setMethod(name); invocation.setEntity(entity); return invocation.submit(responseType); }
@Override public <T> Future<T> method(String name, Entity<?> entity, GenericType<T> responseType) { invocation.setMethod(name); invocation.setEntity(entity); return invocation.submit(responseType); }
@Override public <T> Future<T> method(String name, Entity<?> entity, InvocationCallback<T> callback) { invocation.setMethod(name); invocation.setEntity(entity); return invocation.submit(callback); }
@Override protected ClientInvocation apply(ClientInvocation invocation, Object object) { Form form = null; Object entity = invocation.getEntity(); if (entity != null) { if (entity instanceof Form) { form = (Form) entity; } else { throw new RuntimeException(Messages.MESSAGES.cannotSetFormParameter()); } } else { form = new Form(); invocation.setEntity(Entity.form(form)); } String value = invocation.getClientConfiguration().toString(object); form.param(paramName, value); return invocation; }
@Override public <T> Future<T> put(Entity<?> entity, Class<T> responseType) { invocation.setMethod(HttpMethod.PUT); invocation.setEntity(entity); return invocation.submit(responseType); }
@Override public <T> Future<T> put(Entity<?> entity, GenericType<T> responseType) { invocation.setMethod(HttpMethod.PUT); invocation.setEntity(entity); return invocation.submit(responseType); }
@Override public Future<Response> post(Entity<?> entity) { invocation.setMethod(HttpMethod.POST); invocation.setEntity(entity); return invocation.submit(); }
@Override public <T> Future<T> method(String name, Entity<?> entity, GenericType<T> responseType) { invocation.setMethod(name); invocation.setEntity(entity); return invocation.submit(responseType); }
@Override public Future<Response> method(String name, Entity<?> entity) { invocation.setMethod(name); invocation.setEntity(entity); return invocation.submit(); }
@Override public <T> Future<T> method(String name, Entity<?> entity, Class<T> responseType) { invocation.setMethod(name); invocation.setEntity(entity); return invocation.submit(responseType); }
@Override public <T> Future<T> method(String name, Entity<?> entity, InvocationCallback<T> callback) { invocation.setMethod(name); invocation.setEntity(entity); return invocation.submit(callback); }