public WeatherForecastVO(JSONObject jsonObject) throws APIProtocolException { super(); if (jsonObject == null) throw new APIProtocolException(); try { _periodOfTime = PeriodOfTime.valueOf(((String) jsonObject.get("night_or_day")).toUpperCase()); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _date = DateUtils.parseISO8601String((String) jsonObject.get("date")); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _iconCode = (String) jsonObject.get("icon_code"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _iconURI = (String) jsonObject.get("icon_uri"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _description = (String) jsonObject.get("description"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _descriptionLong = (String) jsonObject.get("description_long"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _geography = new GeographyVO((JSONObject) jsonObject.get("geography")); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _units = MeasurementSystem.valueOf(((String) jsonObject.get("units")).toUpperCase()); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _scale = _units == MeasurementSystem.ENGLISH ? TemperatureScale.FAHRENHEIT : TemperatureScale.CELSIUS; } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _highTemperature = (Long) jsonObject.get("high_temp"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _lowTemperature = (Long) jsonObject.get("low_temp"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _effectiveHighTemperature = (Long) jsonObject.get("effective_high_temp"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _effectiveLowTemperature = (Long) jsonObject.get("effective_low_temp"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _windSpeed = (Long) jsonObject.get("wind_speed"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _windGust = (Long) jsonObject.get("wind_gust"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _windDirection = CardinalDirection.valueOf((String) jsonObject.get("wind_direction")); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _maxUV = (String) jsonObject.get("max_uv"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _rainAmount = (Double) jsonObject.get("rain_amount"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _snowAmount = (Double) jsonObject.get("snow_amount"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _iceAmount = (Double) jsonObject.get("ice_amount"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _totalPrecipitation = (Double) jsonObject.get("total_precipitation"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _thunderstormProbability = (Long) jsonObject.get("thunderstorm_probability"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } try { _detailsURI = (String) jsonObject.get("details_uri"); } catch (Exception exception) { Debug.displayStack(this, exception, 1); } }