public abstract static class AbstractWeatherData.Weather
extends java.lang.Object
Weather
.
Standard behaviors like the has
and the get
methods for information about weather (for example, id, name,
description, icon, etc.) are defined here.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
description
Weather description
|
private java.lang.String |
icon
Weather icon
|
private int |
id
Weather ID
|
private java.lang.String |
JSON_WEATHER_DESCRIPTION
Key for JSON variable
Weather -> Description |
private java.lang.String |
JSON_WEATHER_ICON
Key for JSON variable in array
Weather -> Icon |
private java.lang.String |
JSON_WEATHER_ID
Key for JSON variable in array
Weather -> ID |
private java.lang.String |
JSON_WEATHER_MAIN
Key for JSON variable in array
Weather -> Main (name of weather) |
private java.lang.String |
name
Weather name
|
Constructor and Description |
---|
AbstractWeatherData.Weather()
Non-parameterized constructor
|
AbstractWeatherData.Weather(org.json.JSONObject jsonObj)
Parameterized constructor
Initializes variables from values from the given JSON object.
|
Modifier and Type | Method and Description |
---|---|
int |
getWeatherCode()
Returns data for code for weather of the city.
|
java.lang.String |
getWeatherDescription()
Returns data for description for weather of the city.
|
java.lang.String |
getWeatherIconName()
Returns data for name of icon for weather of the city.
|
java.lang.String |
getWeatherName()
Returns data for name for weather of the city.
|
boolean |
hasWeatherCode()
Tells if the data for weather's code is available or not.
|
boolean |
hasWeatherDescription()
Tells if the data for weather's description is available or not.
|
boolean |
hasWeatherIconName()
Tells if the data for name of weather's icon is available or not.
|
boolean |
hasWeatherName()
Tells if the data for weather's name is available or not.
|
private final java.lang.String JSON_WEATHER_ID
Weather -> ID
private final java.lang.String JSON_WEATHER_MAIN
Weather -> Main (name of weather)
private final java.lang.String JSON_WEATHER_DESCRIPTION
Weather -> Description
private final java.lang.String JSON_WEATHER_ICON
Weather -> Icon
private final int id
private final java.lang.String name
private final java.lang.String description
private final java.lang.String icon
public AbstractWeatherData.Weather()
Initializes variables as per following basis:
Boolean: false
Integral: Minimum value (MIN_VALUE)
Floating point: Not a number (NaN)
Others: null
public AbstractWeatherData.Weather(org.json.JSONObject jsonObj)
jsonObj
- JSON object containing data about weather id, name, etc.public boolean hasWeatherCode()
true
if data available, otherwise false
public boolean hasWeatherName()
true
if data available, otherwise false
public boolean hasWeatherDescription()
true
if data available, otherwise false
public boolean hasWeatherIconName()
true
if data available, otherwise false
public int getWeatherCode()
Integer.MIN_VALUE
public java.lang.String getWeatherName()
null
public java.lang.String getWeatherDescription()
null
public java.lang.String getWeatherIconName()
null