@Test public void testCountCommand() throws Exception { ParseQuery.State<ParseObject> state = new ParseQuery.State.Builder<>("TestObject") .selectKeys(Arrays.asList("key", "kayAgain")) .build(); ParseRESTQueryCommand command = ParseRESTQueryCommand.countCommand(state, "sessionToken"); assertEquals("classes/TestObject", command.httpPath); assertEquals(ParseHttpRequest.Method.GET, command.method); assertEquals("sessionToken", command.getSessionToken()); Map<String, String> parameters = ParseRESTQueryCommand.encode(state, true); JSONObject jsonParameters = (JSONObject) NoObjectsEncoder.get().encode(parameters); assertEquals(jsonParameters, command.jsonParameters, JSONCompareMode.NON_EXTENSIBLE); }
public static <T extends ParseObject> ParseRESTQueryCommand countCommand( ParseQuery.State<T> state, String sessionToken) { String httpPath = String.format("classes/%s", state.className()); Map<String, String> parameters = encode(state, true); return new ParseRESTQueryCommand( httpPath, ParseHttpRequest.Method.GET, parameters, sessionToken); }
ParseRESTQueryCommand extends ParseRESTCommand { public static <T extends ParseObject> ParseRESTQueryCommand countCommand( ParseQuery.State<T> state, String sessionToken) { String httpPath = String.format("classes/%s", state.className()); Map<String, String> parameters = encode(state, true); return new ParseRESTQueryCommand( httpPath, ParseHttpRequest.Method.GET, parameters, sessionToken); } }
ParseRESTQueryCommand extends ParseRESTCommand { public static <T extends ParseObject> ParseRESTQueryCommand countCommand( ParseQuery.State<T> state, String sessionToken) { String httpPath = String.format("classes/%s", state.className()); Map<String, String> parameters = encode(state, true); return new ParseRESTQueryCommand( httpPath, ParseHttpRequest.Method.GET, parameters, sessionToken); } private  ParseRESTQueryCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            Map<String, ?> parameters,
            String sessionToken); }
ParseRESTQueryCommand extends ParseRESTCommand { public static <T extends ParseObject> ParseRESTQueryCommand countCommand( ParseQuery.State<T> state, String sessionToken) { String httpPath = String.format("classes/%s", state.className()); Map<String, String> parameters = encode(state, true); return new ParseRESTQueryCommand( httpPath, ParseHttpRequest.Method.GET, parameters, sessionToken); } private  ParseRESTQueryCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            Map<String, ?> parameters,
            String sessionToken); static ParseRESTQueryCommand findCommand(
            ParseQuery.State<T> state, String sessionToken); static ParseRESTQueryCommand countCommand(
            ParseQuery.State<T> state, String sessionToken); }
ParseRESTQueryCommand extends ParseRESTCommand { public static <T extends ParseObject> ParseRESTQueryCommand countCommand( ParseQuery.State<T> state, String sessionToken) { String httpPath = String.format("classes/%s", state.className()); Map<String, String> parameters = encode(state, true); return new ParseRESTQueryCommand( httpPath, ParseHttpRequest.Method.GET, parameters, sessionToken); } private  ParseRESTQueryCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            Map<String, ?> parameters,
            String sessionToken); static ParseRESTQueryCommand findCommand(
            ParseQuery.State<T> state, String sessionToken); static ParseRESTQueryCommand countCommand(
            ParseQuery.State<T> state, String sessionToken);  }