public JSONObject toJSON() { JSONObject jsonObject = new JSONObject(); jsonObject.put("night_or_day", _periodOfTime.toString().toLowerCase()); jsonObject.put("date", DateUtils.getISO8601String(_date)); jsonObject.put("icon_code", _iconCode); jsonObject.put("icon_uri", _iconURI); jsonObject.put("description", _description); jsonObject.put("description_long", _descriptionLong); jsonObject.put("geography", _geography.toJSON()); jsonObject.put("units", _units.toString().toLowerCase()); jsonObject.put("high_temp", _highTemperature); jsonObject.put("low_temp", _lowTemperature); jsonObject.put("effective_high_temp", _effectiveHighTemperature); jsonObject.put("effective_low_temp", _effectiveLowTemperature); jsonObject.put("wind_speed", _windSpeed); jsonObject.put("wind_gust", _windGust); jsonObject.put("wind_direction", _windDirection.toString().toLowerCase()); jsonObject.put("max_uv", _maxUV); jsonObject.put("rain_amount", _rainAmount); jsonObject.put("snow_amount", _snowAmount); jsonObject.put("ice_amount", _iceAmount); jsonObject.put("total_precipitation", _totalPrecipitation); jsonObject.put("details_uri", _detailsURI); return (jsonObject); }
public JSONObject toJSON() { JSONObject jsonObject = new JSONObject(); if (_service != null) jsonObject.put("service", _service); if (_itemID != null) jsonObject.put("service_item_id", _itemID); if (_reviewID != null) jsonObject.put("service_review_id", _reviewID); jsonObject.put("rating", _rating); jsonObject.put("max_rating", _maxRating); jsonObject.put("min_rating", _minRating); jsonObject.put("votes", _votes); jsonObject.put("helpful_votes", _helpfulVotes); jsonObject.put("rating_img_url", _ratingImageURI); if (_date != null) jsonObject.put("date", DateUtils.getISO8601String(_date)); jsonObject.put("reviewer_name", _reviewerName); jsonObject.put("description", _description); jsonObject.put("reviewer_icon_uri", _reviewerIconURI); jsonObject.put("review_source_uri", _sourceURI); jsonObject.put("review_image_uri", _imageURI); return (jsonObject); }
public String getDateAsString() { return DateUtils.getISO8601String(_date); }