@Test public void test_getDistinctValues02() throws InvalidQueryException { QuerySpec query = new QuerySpec(); query.addCondition(new QueryCondition("unitID", "=", "RMNH.AVES.P.1036")); assertEquals("01", 1, client.getDistinctValues("collectionType", query).size()); }
@Override public Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec) throws InvalidQueryException { String path = "getDistinctValues/" + forField; SimpleHttpRequest request = newQuerySpecRequest(path, querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } TypeReference<Map<String, Long>> typeRef = new TypeReference<Map<String, Long>>() {}; return getObject(request.getResponseBody(), typeRef); }
NbaClient extends Client implements INbaAccess<T> { @Override public Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec) throws InvalidQueryException { String path = "getDistinctValues/" + forField; SimpleHttpRequest request = newQuerySpecRequest(path, querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } TypeReference<Map<String, Long>> typeRef = new TypeReference<Map<String, Long>>() {}; return getObject(request.getResponseBody(), typeRef); } }
NbaClient extends Client implements INbaAccess<T> { @Override public Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec) throws InvalidQueryException { String path = "getDistinctValues/" + forField; SimpleHttpRequest request = newQuerySpecRequest(path, querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } TypeReference<Map<String, Long>> typeRef = new TypeReference<Map<String, Long>>() {}; return getObject(request.getResponseBody(), typeRef); } NbaClient(ClientConfig config, String rootPath); }
NbaClient extends Client implements INbaAccess<T> { @Override public Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec) throws InvalidQueryException { String path = "getDistinctValues/" + forField; SimpleHttpRequest request = newQuerySpecRequest(path, querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } TypeReference<Map<String, Long>> typeRef = new TypeReference<Map<String, Long>>() {}; return getObject(request.getResponseBody(), typeRef); } NbaClient(ClientConfig config, String rootPath); @Override T find(String id); @Override T[] findByIds(String[] ids); @Override QueryResult<T> query(QuerySpec querySpec); @Override long count(QuerySpec querySpec); @Override long countDistinctValues(String forField, QuerySpec querySpec); @Override List<Map<String, Object>> countDistinctValuesPerGroup(String forGroup, String forField,
      QuerySpec querySpec); @Override Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec); @Override List<Map<String, Object>> getDistinctValuesPerGroup(String forGroup, String forField,
      QuerySpec querySpec); }
NbaClient extends Client implements INbaAccess<T> { @Override public Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec) throws InvalidQueryException { String path = "getDistinctValues/" + forField; SimpleHttpRequest request = newQuerySpecRequest(path, querySpec); sendRequest(request); int status = request.getStatus(); if (status != HTTP_OK) { byte[] response = request.getResponseBody(); ServerException exception = newServerException(status, response); if (exception.was(InvalidQueryException.class)) { throw invalidQueryException(exception); } throw exception; } TypeReference<Map<String, Long>> typeRef = new TypeReference<Map<String, Long>>() {}; return getObject(request.getResponseBody(), typeRef); } NbaClient(ClientConfig config, String rootPath); @Override T find(String id); @Override T[] findByIds(String[] ids); @Override QueryResult<T> query(QuerySpec querySpec); @Override long count(QuerySpec querySpec); @Override long countDistinctValues(String forField, QuerySpec querySpec); @Override List<Map<String, Object>> countDistinctValuesPerGroup(String forGroup, String forField,
      QuerySpec querySpec); @Override Map<String, Long> getDistinctValues(String forField, QuerySpec querySpec); @Override List<Map<String, Object>> getDistinctValuesPerGroup(String forGroup, String forField,
      QuerySpec querySpec);  }