Returns the {@link JsonArray} at the given key, or the default if it does not exist or is the
wrong type.
186221
public Json.Array getArray(String key, Json.Array default_) {
    Object o = get(key);
    return (o instanceof Json.Array) ? (Json.Array) o : default_;
  }
187115
private static JsonArray getJsonArray(List<String> keys) {
        JsonArray array = new JsonArray();
        for (String key : keys) {
            array.add(key);
        }

        return array;
    }
1112131
@Override
    public final PArray optArray(final String key, final PArray defaultValue) {
        PArray result = optArray(key);
        return result == null ? defaultValue : result;
    }
1331768
public Object get(String key) throws JSONException {
    Object o = opt(key);
    if (o == null) {
      throw new JSONException("JSONObject[" + quote(key) + "] not found.");
    }
    return o;
  }
1310193
public JSONObject getObjectUseEval(String key) {
        Object object = eval(key);
        return Checker.isNull(object) ? null : (JSONObject) object;
    }
701255
public <T> T get(String key, T defaultValue) {
        if (map.containsKey(key)) {
            Object value = map.get(key);
            return (T)(value instanceof byte[] ? unmarshall((byte[])value) : value);
        }
        return defaultValue;
    }
278775
public Json.Object getObject(String key, Json.Object default_) {
    Object o = get(key);
    return (o instanceof JsonObject) ? (JsonObject)o : default_;
  }
822297
public JSONArray getJSONArray( String key ) {
      verifyIsNull();
      Object o = get( key );
      if( o != null && o instanceof JSONArray ){
         return (JSONArray) o;
      }
      throw new JSONException( "JSONObject[" + JSONUtils.quote( key ) + "] is not a JSONArray." );
   }
449592
private JSONArray readOptionalArray(JSONObject json, String key) {

        try {
            return json.getJSONArray(key);
        } catch (JSONException e) {
            LOG.debug("Reading optional JSON array failed. Default to provided default value.", e);
        }
        return null;
    }
833880
static javax.json.JsonValue map(final JsonValue jsonValue) {
        if (jsonValue instanceof JsonArray)
            return map((JsonArray) jsonValue);
        return map((JsonObject) jsonValue);
    }
1075981
public LazyArray getJSONArray(String key) throws LazyException{
		LazyNode token=getFieldToken(key);
		if(token.type!=LazyNode.ARRAY)throw new LazyException("Requested value is not an array",token);
		LazyArray arr=new LazyArray(token);
		arr.parent=this;
		return arr;
	}
845340
public Json.Object getObject(int key, Json.Object default_) {
    Object o = get(key);
    return o instanceof Json.Object ? (Json.Object)get(key) : default_;
  }
77502
public JSONArray asJSONArray() throws TwitterException {
        if (jsonArray == null) {
            try {
                jsonArray = new JSONArray(asString());
                if (CONF.isPrettyDebugEnabled()) {
                    logger.debug(jsonArray.toString(1));
                } else {
                    logger.debug(responseAsString != null ? responseAsString :
                        jsonArray.toString());
                }
            } catch (JSONException jsone) {
                if (logger.isDebugEnabled()) {
                    throw new TwitterException(jsone.getMessage() + ":" + this.responseAsString, jsone);
                } else {
                    throw new TwitterException(jsone.getMessage(), jsone);
                }
            } finally {
                disconnectForcibly();
            }
        }
        return jsonArray;
    }
1254957
protected static String getString(JSONObject json, String key) {

        JSONValue value = json.get(key);
        JSONString str = value.isString();
        if (str == null) {
            return null;
        }
        return str.stringValue();
    }
550094
public static JSONArray getBaseArray() {
		ensureLoaded();
		JSONArray baseArray = new JSONArray();
		for (VersionHistoryEntry entry : versionHistoryEntries) {
			baseArray.put(entry);
		}
		return baseArray;
	}
1295334
public static String findUniqueKey(JSONArray expected) throws JSONException {
        // Find a unique key for the object (id, name, whatever)
        JSONObject o = (JSONObject) expected.get(0); // There's at least one at this point
        for (String candidate : getKeys(o)) {
            if (isUsableAsUniqueKey(candidate, expected)) return candidate;
        }
        // No usable unique key :-(
        return null;
    }
1014878
public String get(String key, String defaultValue) {
		addToDefaults(key, defaultValue);
		String value = get(key);
		if (value == null) {
			return defaultValue;
		} else {
			return value;
		}
	}