@Test public void searchInstallation() throws Exception { JSONObject query = new JSONObject(); query.put("where", new JSONObject("{deviceType:android}")); query.put("limit", 2); NCMBInstallationService installationService = (NCMBInstallationService) NCMB.factory(NCMB.ServiceType.INSTALLATION); List results = installationService.searchInstallation(query); for (int i = 0; i < results.size(); i++) { Assert.assertEquals("android", ((NCMBInstallation) results.get(i)).getDeviceType()); } }
public List searchInstallation(JSONObject conditions) throws NCMBException { RequestParams request = createRequestParams(null, null, conditions, NCMBRequest.HTTP_METHOD_GET); NCMBResponse response = sendRequest(request); if (response.statusCode != HTTP_STATUS_INSTALLATION_GOTTEN) { throw new NCMBException(NCMBException.NOT_EFFICIENT_VALUE, "Gotten failed."); } return createSearchResults(response.responseData); }
NCMBInstallationService extends NCMBService { public List searchInstallation(JSONObject conditions) throws NCMBException { RequestParams request = createRequestParams(null, null, conditions, NCMBRequest.HTTP_METHOD_GET); NCMBResponse response = sendRequest(request); if (response.statusCode != HTTP_STATUS_INSTALLATION_GOTTEN) { throw new NCMBException(NCMBException.NOT_EFFICIENT_VALUE, "Gotten failed."); } return createSearchResults(response.responseData); } }
NCMBInstallationService extends NCMBService { public List searchInstallation(JSONObject conditions) throws NCMBException { RequestParams request = createRequestParams(null, null, conditions, NCMBRequest.HTTP_METHOD_GET); NCMBResponse response = sendRequest(request); if (response.statusCode != HTTP_STATUS_INSTALLATION_GOTTEN) { throw new NCMBException(NCMBException.NOT_EFFICIENT_VALUE, "Gotten failed."); } return createSearchResults(response.responseData); } NCMBInstallationService(NCMBContext context); }
NCMBInstallationService extends NCMBService { public List searchInstallation(JSONObject conditions) throws NCMBException { RequestParams request = createRequestParams(null, null, conditions, NCMBRequest.HTTP_METHOD_GET); NCMBResponse response = sendRequest(request); if (response.statusCode != HTTP_STATUS_INSTALLATION_GOTTEN) { throw new NCMBException(NCMBException.NOT_EFFICIENT_VALUE, "Gotten failed."); } return createSearchResults(response.responseData); } NCMBInstallationService(NCMBContext context); JSONObject createInstallation(String registrationId, JSONObject params); void createInstallationInBackground(String registrationId, JSONObject params, final ExecuteServiceCallback callback); JSONObject updateInstallation(String objectId, JSONObject params); void updateInstallationInBackground(final String objectId, JSONObject params, final ExecuteServiceCallback callback); void deleteInstallation(String objectId); void deleteInstallationInBackground(final String objectId, DoneCallback callback); NCMBInstallation fetchInstallation(String objectId); void fetchInstallationInBackground(String objectId, final FetchCallback callback); List searchInstallation(JSONObject conditions); void searchInstallationInBackground(JSONObject conditions, final SearchInstallationCallback callback); }
NCMBInstallationService extends NCMBService { public List searchInstallation(JSONObject conditions) throws NCMBException { RequestParams request = createRequestParams(null, null, conditions, NCMBRequest.HTTP_METHOD_GET); NCMBResponse response = sendRequest(request); if (response.statusCode != HTTP_STATUS_INSTALLATION_GOTTEN) { throw new NCMBException(NCMBException.NOT_EFFICIENT_VALUE, "Gotten failed."); } return createSearchResults(response.responseData); } NCMBInstallationService(NCMBContext context); JSONObject createInstallation(String registrationId, JSONObject params); void createInstallationInBackground(String registrationId, JSONObject params, final ExecuteServiceCallback callback); JSONObject updateInstallation(String objectId, JSONObject params); void updateInstallationInBackground(final String objectId, JSONObject params, final ExecuteServiceCallback callback); void deleteInstallation(String objectId); void deleteInstallationInBackground(final String objectId, DoneCallback callback); NCMBInstallation fetchInstallation(String objectId); void fetchInstallationInBackground(String objectId, final FetchCallback callback); List searchInstallation(JSONObject conditions); void searchInstallationInBackground(JSONObject conditions, final SearchInstallationCallback callback); static final String SERVICE_PATH; static final int HTTP_STATUS_INSTALLATION_CREATED; static final int HTTP_STATUS_INSTALLATION_UPDATED; static final int HTTP_STATUS_INSTALLATION_DELETED; static final int HTTP_STATUS_INSTALLATION_GOTTEN; }