Code example for JSONObject

Methods: getString, isNull

0
	 * @param key 
	 * @return 
	 * @throws JSONException 
	 */ 
	private static String getStringWithNull(JSONObject object, String key) throws JSONException{
		if(object.isNull(key)) return null;
		return object.getString(key);
	} 
 
	@Override 
	public List<EntityData> getAllChildrenOfEntity(String parentId) throws SynapseException, JSONException, InterruptedException {
		String rootQuery = QUERY_CHILDREN_OF_ENTITY1 + "\"" + parentId + "\"";
		return queryForAllPages(rootQuery, ENTITY, MAX_PAGE_SIZE, null);
	} 
	 
	/** 
	 * Get all of the pages starting with a root query. 
	 * This will execute the query one page at a time until all of the results are fetched. The page size is set by the limit. 
	 * @param client 
	 * @param rootQuery 
	 * @param limit