@Test public void testFromJSONObject() throws Exception { String httpPath = "www.parse.com"; JSONObject jsonParameters = new JSONObject() .put("count", 1) .put("limit", 1); String sessionToken = "sessionToken"; String localId = "localId"; String httpMethod = "POST"; JSONObject commandJSON = new JSONObject() .put("httpPath", httpPath) .put("parameters", jsonParameters) .put("httpMethod", httpMethod) .put("sessionToken", sessionToken) .put("localId", localId); ParseRESTCommand command = ParseRESTCommand.fromJSONObject(commandJSON); assertEquals(httpPath, command.httpPath); assertEquals(httpMethod, command.method.toString()); assertEquals(sessionToken, command.getSessionToken()); assertEquals(localId, command.getLocalId()); assertEquals(jsonParameters, command.jsonParameters, JSONCompareMode.NON_EXTENSIBLE); }
public static ParseRESTCommand fromJSONObject(JSONObject jsonObject) { String httpPath = jsonObject.optString("httpPath"); ParseHttpRequest.Method httpMethod = ParseHttpRequest.Method.fromString(jsonObject.optString("httpMethod")); String sessionToken = jsonObject.optString("sessionToken", null); String localId = jsonObject.optString("localId", null); JSONObject jsonParameters = jsonObject.optJSONObject("parameters"); return new ParseRESTCommand(httpPath, httpMethod, jsonParameters, localId, sessionToken); }
ParseRESTCommand extends ParseRequest<JSONObject> { public static ParseRESTCommand fromJSONObject(JSONObject jsonObject) { String httpPath = jsonObject.optString("httpPath"); ParseHttpRequest.Method httpMethod = ParseHttpRequest.Method.fromString(jsonObject.optString("httpMethod")); String sessionToken = jsonObject.optString("sessionToken", null); String localId = jsonObject.optString("localId", null); JSONObject jsonParameters = jsonObject.optJSONObject("parameters"); return new ParseRESTCommand(httpPath, httpMethod, jsonParameters, localId, sessionToken); } }
ParseRESTCommand extends ParseRequest<JSONObject> { public static ParseRESTCommand fromJSONObject(JSONObject jsonObject) { String httpPath = jsonObject.optString("httpPath"); ParseHttpRequest.Method httpMethod = ParseHttpRequest.Method.fromString(jsonObject.optString("httpMethod")); String sessionToken = jsonObject.optString("sessionToken", null); String localId = jsonObject.optString("localId", null); JSONObject jsonParameters = jsonObject.optJSONObject("parameters"); return new ParseRESTCommand(httpPath, httpMethod, jsonParameters, localId, sessionToken); } ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            Map<String, ?> parameters,
            String sessionToken);  ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            JSONObject jsonParameters,
            String sessionToken); private  ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            JSONObject jsonParameters,
            String localId, String sessionToken);   ParseRESTCommand(Init<?> builder); }
ParseRESTCommand extends ParseRequest<JSONObject> { public static ParseRESTCommand fromJSONObject(JSONObject jsonObject) { String httpPath = jsonObject.optString("httpPath"); ParseHttpRequest.Method httpMethod = ParseHttpRequest.Method.fromString(jsonObject.optString("httpMethod")); String sessionToken = jsonObject.optString("sessionToken", null); String localId = jsonObject.optString("localId", null); JSONObject jsonParameters = jsonObject.optJSONObject("parameters"); return new ParseRESTCommand(httpPath, httpMethod, jsonParameters, localId, sessionToken); } ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            Map<String, ?> parameters,
            String sessionToken);  ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            JSONObject jsonParameters,
            String sessionToken); private  ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            JSONObject jsonParameters,
            String localId, String sessionToken);   ParseRESTCommand(Init<?> builder); static ParseRESTCommand fromJSONObject(JSONObject jsonObject); @Override Task<JSONObject> executeAsync(
            final ParseHttpClient client,
            final ProgressCallback uploadProgressCallback,
            final ProgressCallback downloadProgressCallback,
            final Task<Void> cancellationToken); String getCacheKey(); JSONObject toJSONObject(); String getSessionToken(); String getOperationSetUUID(); String getLocalId(); void setLocalId(String localId); void resolveLocalIds(); void retainLocalIds(); void releaseLocalIds(); }
ParseRESTCommand extends ParseRequest<JSONObject> { public static ParseRESTCommand fromJSONObject(JSONObject jsonObject) { String httpPath = jsonObject.optString("httpPath"); ParseHttpRequest.Method httpMethod = ParseHttpRequest.Method.fromString(jsonObject.optString("httpMethod")); String sessionToken = jsonObject.optString("sessionToken", null); String localId = jsonObject.optString("localId", null); JSONObject jsonParameters = jsonObject.optJSONObject("parameters"); return new ParseRESTCommand(httpPath, httpMethod, jsonParameters, localId, sessionToken); } ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            Map<String, ?> parameters,
            String sessionToken);  ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            JSONObject jsonParameters,
            String sessionToken); private  ParseRESTCommand(
            String httpPath,
            ParseHttpRequest.Method httpMethod,
            JSONObject jsonParameters,
            String localId, String sessionToken);   ParseRESTCommand(Init<?> builder); static ParseRESTCommand fromJSONObject(JSONObject jsonObject); @Override Task<JSONObject> executeAsync(
            final ParseHttpClient client,
            final ProgressCallback uploadProgressCallback,
            final ProgressCallback downloadProgressCallback,
            final Task<Void> cancellationToken); String getCacheKey(); JSONObject toJSONObject(); String getSessionToken(); String getOperationSetUUID(); String getLocalId(); void setLocalId(String localId); void resolveLocalIds(); void retainLocalIds(); void releaseLocalIds(); public String masterKey; }