public T create(T toCreate) throws HttpException { Response<T> response = DefaultRequestHandler.getInstance() .doRequest(HttpMethod.POST, getResourcesPath(), toCreate); I id = (I) (toCreate.getId() == null ? getCreatedId(response) : toCreate.getId()); return get(id); }
public T update(T toUpdate) throws HttpException { DefaultRequestHandler.getInstance() .doRequest(HttpMethod.PUT, getResourcePath((I) toUpdate.getId()), toUpdate); return toUpdate; }
public void delete(I id) throws HttpException { DefaultRequestHandler.getInstance().doRequest(HttpMethod.DELETE, getResourcePath(id)); }
public T get(I id) throws HttpException, ParseToObjectException { Response<T> response = DefaultRequestHandler.getInstance().doRequest(HttpMethod.GET, getResourcePath(id)); return response.getBodyAsObject(getObjectClass()); }