Package org.json

Examples of org.json.JSONObject.optInt()


      } else if (classRes.hashCode() == ContactsResponse.class.hashCode()) {
        oData = new JSONObject(data);
        return new ContactsResponse(oData.optInt("count"), oData.optString("list"));
      } else if (classRes.hashCode() == ContactResponse.class.hashCode()) {
        oData = new JSONObject(data);
        return new ContactResponse(oData.optString("number"), oData.optString("first_name"), oData.optString("last_name"), oData.optString("info"), oData.optString("birthday"), oData.optString("city"), oData.optString("gender"), oData.optInt("date_add"), oData.optInt("date_mod"));
      } else if (classRes.hashCode() == RawResponse.class.hashCode()) {
        return new RawResponse(data);
      }

      return null;
View Full Code Here


      } else if (classRes.hashCode() == ContactsResponse.class.hashCode()) {
        oData = new JSONObject(data);
        return new ContactsResponse(oData.optInt("count"), oData.optString("list"));
      } else if (classRes.hashCode() == ContactResponse.class.hashCode()) {
        oData = new JSONObject(data);
        return new ContactResponse(oData.optString("number"), oData.optString("first_name"), oData.optString("last_name"), oData.optString("info"), oData.optString("birthday"), oData.optString("city"), oData.optString("gender"), oData.optInt("date_add"), oData.optInt("date_mod"));
      } else if (classRes.hashCode() == RawResponse.class.hashCode()) {
        return new RawResponse(data);
      }

      return null;
View Full Code Here

    this.attDescription = attDescription;
  }
 
  public int getOrientationLevel() throws Exception {
    JSONObject serverWorkObj = getJson();
    int orientationLevel = serverWorkObj.optInt(UploadConstants.SERVER_ORIENTATION_KEY, 0);
    return orientationLevel;
  }
 
  public void setOrientationLevel(int level) throws Exception {
    JSONObject serverWorkObj = getJson();
View Full Code Here

    attDescription.setSavingRequired(true);
  }
 
  public int getThumbnailLevel() throws Exception {
    JSONObject serverWorkObj = getJson();
    int thumbnailLevel = serverWorkObj.optInt(UploadConstants.SERVER_THUMBNAIL_KEY, 0);
    return thumbnailLevel;
  }
 
  public void setThumbnailLevel(int level) throws Exception {
    JSONObject serverWorkObj = getJson();
View Full Code Here

            return true;
          } else if( false == JSONSupport.containsKey(attachmentManifest,"revpos") ) {
            // revpos is gone, document must have been modified
            return true;
          } else {
            int revpos = attachmentManifest.optInt("revpos",0);
            Integer actualRevPos = getAttachmentPosition(targetDoc,attachmentName);
            if( null == actualRevPos ) {
              // Attachment is gone
              return true;
            } else if( revpos != actualRevPos.intValue() ){
View Full Code Here

      // Target document does not have an attachment with this name
      return null;
    }
   
    if( JSONSupport.containsKey(targetAttachment,"revpos") ){
      int revPos = targetAttachment.optInt("revpos",-1);
      if( revPos < 0 ){
        return null;
      }
      return revPos;
    }
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.