Exemplo n.º 1
0
 public Object getObject(Object object, int objectId) {
   String endpoint = getAnnotatedEndpoint(object);
   String requestUri = configuration.getApiBaseUri() + endpoint + "/" + objectId;
   GetRequest request = UnirestUtil.get(requestUri, headers());
   Get get = new Get(UnirestUtil.getObjectResponse(request), object);
   object = get.getAsObject();
   apiErrorCollection = get.getApiErrorCollection();
   return object;
 }
Exemplo n.º 2
0
 public <T> List<?> getList(Object object) {
   String endpoint = getAnnotatedEndpoint(object);
   String requestUri = configuration.getApiBaseUri() + endpoint;
   GetRequest request = UnirestUtil.get(requestUri, headers());
   Get get = new Get(UnirestUtil.getObjectResponse(request), object);
   List<?> list = get.getAsList();
   apiErrorCollection = get.getApiErrorCollection();
   return list;
 }