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); } }
public ReviewVO(JSONObject jsonObject) throws APIProtocolException { super(); try { _service = (String) jsonObject.get("service"); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _itemID = (String) jsonObject.get("service_item_id"); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _reviewID = (String) jsonObject.get("service_review_id"); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _rating = Double.parseDouble("" + jsonObject.get("rating")); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _maxRating = Double.parseDouble("" + jsonObject.get("max_rating")); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _minRating = Double.parseDouble("" + jsonObject.get("min_rating")); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _votes = Integer.parseInt("" + jsonObject.get("votes")); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _helpfulVotes = Integer.parseInt("" + jsonObject.get("helpful_votes")); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _ratingImageURI = (String) jsonObject.get("rating_img_url"); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _date = DateUtils.parseISO8601String((String) jsonObject.get("date")); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _reviewerName = (String) jsonObject.get("reviewer_name"); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _description = (String) jsonObject.get("description"); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _reviewerIconURI = (String) jsonObject.get("reviewer_icon_uri"); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _sourceURI = (String) jsonObject.get("review_source_uri"); } catch (Exception exception) { Debug.displayStack(this, exception); } try { _imageURI = (String) jsonObject.get("review_image_uri"); } catch (Exception exception) { Debug.displayStack(this, exception); } }