protected Long getLong ( final String key , final JSONObject jsonObject ) { Long value = null ; if ( hasKey ( key , jsonObject ) ) { try { value = jsonObject . getLong ( key ) ; } catch ( JSONException e ) { LOGGER . error ( "Could not get Long from JSONObject for key: " + key , e ) ; } } return value ; }
Check to make sure the JSONObject has the specified key and if so return the value as a long . If no key is found null is returned .