protected Double getDouble ( final String key , final JSONObject jsonObject ) { Double value = null ; if ( hasKey ( key , jsonObject ) ) { try { value = jsonObject . getDouble ( key ) ; } catch ( JSONException e ) { LOGGER . error ( "Could not get Double 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 double . If no key is found null is returned .