Code example for JSONArray

Methods: getStringisNull

            if (value != null) 
                array.put(index, value); 
        public String getValue(JSONArray array, int index) throws JSONException { 
            return array.isNull(index) ? null : array.getString(index); 
    public static final JSONTransformer<Long> LONG = new JSONTransformer<Long>() { 
        public void setValue(JSONObject json, String key, Long value) throws JSONException { 
            if (value != null) 
                json.put(key, (long) value); 
        public Long getValue(JSONObject json, String key) throws JSONException { 
            return json.isNull(key) ? null : json.getLong(key); 
        public void addValue(JSONArray array, Long value) throws JSONException { 
Connect your IDE to all the code out there  Get Codota for Java