public static class

WeatherInfo.Builder

extends Object
java.lang.Object
   ↳ cyanogenmod.weather.WeatherInfo.Builder

Class Overview

Builder class for WeatherInfo

Summary

Public Constructors
WeatherInfo.Builder(String cityName, double temperature, int tempUnit)
Public Methods
WeatherInfo build()
Combine all of the options that have been set and return a new WeatherInfo object
WeatherInfo.Builder setForecast(List<WeatherInfo.DayForecast> forecasts)
WeatherInfo.Builder setHumidity(double humidity)
WeatherInfo.Builder setTimestamp(long timeStamp)
WeatherInfo.Builder setTodaysHigh(double todaysHigh)
WeatherInfo.Builder setTodaysLow(double todaysLow)
WeatherInfo.Builder setWeatherCondition(int conditionCode)
WeatherInfo.Builder setWind(double windSpeed, double windDirection, int windSpeedUnit)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WeatherInfo.Builder (String cityName, double temperature, int tempUnit)

Added in API level 5

Parameters
cityName A valid city name. Attempting to pass null will get you an IllegalArgumentException
temperature A valid temperature value. Attempting pass an invalid double value, will get you an IllegalArgumentException
tempUnit A valid temperature unit value. See WeatherContract.WeatherColumns.TempUnit for valid values. Attempting to pass an invalid temperature unit will get you an IllegalArgumentException

Public Methods

public WeatherInfo build ()

Added in API level 5

Combine all of the options that have been set and return a new WeatherInfo object

Returns

public WeatherInfo.Builder setForecast (List<WeatherInfo.DayForecast> forecasts)

Added in API level 5

Parameters
forecasts A valid array list of WeatherInfo.DayForecast objects. Attempting to pass null will get you an IllegalArgumentException'
Returns

public WeatherInfo.Builder setHumidity (double humidity)

Added in API level 5

Parameters
humidity The weather humidity. Attempting to pass an invalid double value will get you an IllegalArgumentException
Returns

public WeatherInfo.Builder setTimestamp (long timeStamp)

Added in API level 5

Parameters
timeStamp A timestamp indicating when this data was generated. If timestamps is not set, then the builder will set it to the time of object creation
Returns

public WeatherInfo.Builder setTodaysHigh (double todaysHigh)

Added in API level 5

Parameters
todaysHigh Today's high temperature. Attempting to pass an invalid double value will get you an IllegalArgumentException
Returns

public WeatherInfo.Builder setTodaysLow (double todaysLow)

Added in API level 5

Parameters
todaysLow Today's low temperature. Attempting to pass an invalid double value will get you an IllegalArgumentException

public WeatherInfo.Builder setWeatherCondition (int conditionCode)

Added in API level 5

Parameters
conditionCode A valid weather condition code. See WeatherContract.WeatherColumns.WeatherCode for valid codes. Attempting to pass an invalid code will get you an IllegalArgumentException.
Returns

public WeatherInfo.Builder setWind (double windSpeed, double windDirection, int windSpeedUnit)

Added in API level 5

Parameters
windSpeed The wind speed. Attempting to pass an invalid double value will get you an IllegalArgumentException
windDirection The wind direction. Attempting to pass an invalid double value will get you an IllegalArgumentException
windSpeedUnit A valid wind speed direction unit. See WeatherContract.WeatherColumns.WindSpeedUnit for valid values. Attempting to pass an invalid speed unit will get you an IllegalArgumentException
Returns