algoliasearch/src/main/java/com/algolia/search/saas/Index.java
public JSONObject getObject(String objectID, Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions) throws AlgoliaException {
        try {
            String path = "/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8");
            Map<String, String> urlParameters = new HashMap<>();
            if (attributesToRetrieve != null) {
                urlParameters.put("attributesToRetrieve", AbstractQuery.buildCommaArray(attributesToRetrieve.toArray(new String[attributesToRetrieve.size()])));
            }
            return client.getRequest(path, urlParameters, false, requestOptions);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
public JSONObject getObject(String objectID, Collection<String> attributesToRetrieve, @Nullable RequestOptions requestOptions) throws AlgoliaException {
        try {
            String path = "/1/indexes/" + encodedIndexName + "/" + URLEncoder.encode(objectID, "UTF-8");
            Map<String, String> urlParameters = new HashMap<>();
            if (attributesToRetrieve != null) {
                urlParameters.put("attributesToRetrieve", AbstractQuery.buildCommaArray(attributesToRetrieve.toArray(new String[attributesToRetrieve.size()])));
            }
            return client.getRequest(path, urlParameters, false, requestOptions);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
Gets an object from this index.

@param objectID             the unique identifier of the object to retrieve
@param attributesToRetrieve contains the list of attributes to retrieve.
@param requestOptions       Request-specific options.
@throws AlgoliaException