Examples of optBoolean()


Examples of org.json.JSONObject.optBoolean()

        final JSONObject preference = preferenceUtils.getPreference();
        if (null == preference) {
            throw new EventException("Not found preference");
        }

        final boolean enabled = preference.optBoolean(
                Preference.ENABLE_POST_TO_TENCENT_MICROBLOG);
        if (!enabled) {
            return;
        }
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

    boolean sendDenialEmail = false;
    JSONObject denialEmail = submissionDoc
      .getJSONObject("nunaliit_submission")
      .optJSONObject("denial_email");
    if( null != denialEmail ){
      boolean requested = denialEmail.optBoolean("requested",false);
      boolean sent = denialEmail.optBoolean("sent",false);
     
      if( requested && !sent ){
        sendDenialEmail = true;
      }
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

    JSONObject denialEmail = submissionDoc
      .getJSONObject("nunaliit_submission")
      .optJSONObject("denial_email");
    if( null != denialEmail ){
      boolean requested = denialEmail.optBoolean("requested",false);
      boolean sent = denialEmail.optBoolean("sent",false);
     
      if( requested && !sent ){
        sendDenialEmail = true;
      }
    }
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

    logger.debug("IN");
    JSONArray staticClosedFilters = template.optJSONArray(QbeJSONTemplateParser.STATIC_CLOSED_FILTERS);
    if (staticClosedFilters != null && staticClosedFilters.length() > 0) {
      for (int i = 0; i < staticClosedFilters.length(); i++) {
        JSONObject aStaticClosedFilter = (JSONObject) staticClosedFilters.get(i);
        boolean isSingleSelection = aStaticClosedFilter.optBoolean(QbeJSONTemplateParser.STATIC_CLOSED_FILTER_SINGLE_SELECTION);
        String filterGroupId = aStaticClosedFilter.getString(QbeJSONTemplateParser.ID);
        if (isSingleSelection) {
          String optionId = formViewerState.getXORFilterSelectedOption(filterGroupId);
          if (optionId != null && !optionId.trim().equals("") && !optionId.equalsIgnoreCase(QbeJSONTemplateParser.STATIC_CLOSED_FILTER_NO_SELECTION)) {
            JSONObject option = null;
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

        String name = cookie.optString("name");
        String value = cookie.optString("value");
        String domain = cookie.optString("domain");
        String path = cookie.optString("path");
        Date expiry = new Date(cookie.optLong("expires"));
        boolean isSecure = cookie.optBoolean("secure");
        Cookie c = new Cookie(name, value, domain, path, expiry, isSecure);
        res.add(c);
      }
      return res;
    } else {
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

    // validate branch metadata
    JSONObject branch = branchesArray.getJSONObject(0);
    assertEquals(Constants.MASTER, branch.getString(ProtocolConstants.KEY_NAME));
    assertBranchUri(branch.getString(ProtocolConstants.KEY_LOCATION));
    assertTrue(branch.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false));
    branch = branchesArray.getJSONObject(1);
    assertEquals("z", branch.getString(ProtocolConstants.KEY_NAME));
    // assert properly sorted, current branch is first, then other branches sorted by timestamp
    long lastTime = Long.MAX_VALUE;
    for (int i = 1; i < branchesArray.length(); i++) {
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

      JSONArray branchesArray = branches.getJSONArray(ProtocolConstants.KEY_CHILDREN);
      assertEquals(2, branchesArray.length());
      JSONObject branch0 = branchesArray.getJSONObject(0);
      JSONObject branch1 = branchesArray.getJSONObject(1);
      if (branch0.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false))
        assertFalse(branch1.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false));
      else
        assertTrue(branch1.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false));

      // remove branch
      request = getDeleteGitBranchRequest(branchLocation);
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

      JSONObject branch0 = branchesArray.getJSONObject(0);
      JSONObject branch1 = branchesArray.getJSONObject(1);
      if (branch0.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false))
        assertFalse(branch1.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false));
      else
        assertTrue(branch1.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false));

      // remove branch
      request = getDeleteGitBranchRequest(branchLocation);
      response = webConversation.getResponse(request);
      assertTrue(HttpURLConnection.HTTP_OK == response.getResponseCode() || HttpURLConnection.HTTP_ACCEPTED == response.getResponseCode());
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

      assertTrue(status.toString(), status.isOK());
      branches = status.getJsonData();
      branchesArray = branches.getJSONArray(ProtocolConstants.KEY_CHILDREN);
      assertEquals(1, branchesArray.length());
      JSONObject branch = branchesArray.getJSONObject(0);
      assertTrue(branch.optBoolean(GitConstants.KEY_BRANCH_CURRENT, false));
    }
  }

  @Test
  public void testCreateTrackingBranch() throws Exception {
View Full Code Here

Examples of org.json.JSONObject.optBoolean()

    JSONObject attributes = source.optJSONObject(ProtocolConstants.KEY_ATTRIBUTES);
    if (attributes != null) {
      for (int i = 0; i < ATTRIBUTE_KEYS.length; i++) {
        //undefined means the client does not want to change the value, so can't interpret as false
        if (!attributes.isNull(ATTRIBUTE_KEYS[i]))
          destination.setAttribute(ATTRIBUTE_BITS[i], attributes.optBoolean(ATTRIBUTE_KEYS[i]));
      }
    }
  }

  public static IFileInfo fromJSON(HttpServletRequest request) throws IOException, JSONException {
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.