Package org.json

Examples of org.json.JSONObject.optDouble()


    JSONObject payload = request.getPayload();

    String js = template.generate(
        request.getSession(),
        payload.optDouble("fromX"),
        payload.optDouble("fromY"),
        payload.optDouble("toX"),
        payload.optDouble("toY"),
        payload.optDouble("duration"));
    setJS(js);
View Full Code Here


    JSONObject payload = request.getPayload();

    String js = template.generate(
        request.getSession(),
        payload.optDouble("fromX"),
        payload.optDouble("fromY"),
        payload.optDouble("toX"),
        payload.optDouble("toY"),
        payload.optDouble("duration"));
    setJS(js);
  }
View Full Code Here

    String js = template.generate(
        request.getSession(),
        payload.optDouble("fromX"),
        payload.optDouble("fromY"),
        payload.optDouble("toX"),
        payload.optDouble("toY"),
        payload.optDouble("duration"));
    setJS(js);
  }
View Full Code Here

    String js = template.generate(
        request.getSession(),
        payload.optDouble("fromX"),
        payload.optDouble("fromY"),
        payload.optDouble("toX"),
        payload.optDouble("toY"),
        payload.optDouble("duration"));
    setJS(js);
  }

  @Override
View Full Code Here

        request.getSession(),
        payload.optDouble("fromX"),
        payload.optDouble("fromY"),
        payload.optDouble("toX"),
        payload.optDouble("toY"),
        payload.optDouble("duration"));
    setJS(js);
  }

  @Override
  public JSONObject configurationDescription() throws JSONException {
View Full Code Here

    public void testObject() {
        JSONObject json = OTJson.object("string", "string", "int", 123, "double", 123.456, "true", true, "false", false, "null", null);
        Assert.assertNotNull(json);
        Assert.assertEquals("string", json.optString("string"));
        Assert.assertEquals(123, json.optInt("int"));
        Assert.assertEquals(123.456, json.optDouble("double"), 1e-15);
        Assert.assertEquals(true, json.optBoolean("true"));
        Assert.assertEquals(false, json.optBoolean("false"));
        Assert.assertEquals(null, json.opt("null"));
    }
View Full Code Here

        JSONObject userJson = wrapped ? jsonObject.getJSONObject("user") : jsonObject;
        encodedId = userJson.getString("encodedId");
        displayName = userJson.getString("displayName");
        gender = Gender.valueOf(userJson.getString("gender"));
        dateOfBirth = FitbitApiService.getValidLocalDateOrNull(userJson.optString("dateOfBirth"));
        height = userJson.optDouble("height");
        weight = userJson.optDouble("weight");
        strideLengthWalking = userJson.optDouble("strideLengthWalking");
        strideLengthRunning = userJson.optDouble("strideLengthRunning");
        fullName = userJson.optString("fullName");
        nickname = userJson.optString("nickname");
View Full Code Here

        encodedId = userJson.getString("encodedId");
        displayName = userJson.getString("displayName");
        gender = Gender.valueOf(userJson.getString("gender"));
        dateOfBirth = FitbitApiService.getValidLocalDateOrNull(userJson.optString("dateOfBirth"));
        height = userJson.optDouble("height");
        weight = userJson.optDouble("weight");
        strideLengthWalking = userJson.optDouble("strideLengthWalking");
        strideLengthRunning = userJson.optDouble("strideLengthRunning");
        fullName = userJson.optString("fullName");
        nickname = userJson.optString("nickname");
        country = userJson.optString("country");
View Full Code Here

        displayName = userJson.getString("displayName");
        gender = Gender.valueOf(userJson.getString("gender"));
        dateOfBirth = FitbitApiService.getValidLocalDateOrNull(userJson.optString("dateOfBirth"));
        height = userJson.optDouble("height");
        weight = userJson.optDouble("weight");
        strideLengthWalking = userJson.optDouble("strideLengthWalking");
        strideLengthRunning = userJson.optDouble("strideLengthRunning");
        fullName = userJson.optString("fullName");
        nickname = userJson.optString("nickname");
        country = userJson.optString("country");
        state = userJson.optString("state");
View Full Code Here

        gender = Gender.valueOf(userJson.getString("gender"));
        dateOfBirth = FitbitApiService.getValidLocalDateOrNull(userJson.optString("dateOfBirth"));
        height = userJson.optDouble("height");
        weight = userJson.optDouble("weight");
        strideLengthWalking = userJson.optDouble("strideLengthWalking");
        strideLengthRunning = userJson.optDouble("strideLengthRunning");
        fullName = userJson.optString("fullName");
        nickname = userJson.optString("nickname");
        country = userJson.optString("country");
        state = userJson.optString("state");
        city = userJson.optString("city");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.