public Event(JSONObject data) { raw = data; id = data.getString("id"); domain = data.getString("domain"); from = data.getString("from"); datetime = data.getInt("datetime"); type = data.getString("type"); }
public TimeZone resolveTimeZone(double latitude, double longitude) { try { String content = readContent(latitude, longitude); if (content == null) { return null; } JSONObject response = new JSONObject(content); String timeZoneId = response.getString("timezoneId"); return TimeZone.getTimeZone(timeZoneId); } catch (Exception ex) { logger.error( String.format( "Unable to use %s to resolve time zone for %f, %f: %s", geonamesURL, latitude, longitude, InternalUtils.toMessage(ex)), ex); return null; } }