Package com.aerisweather.aeris.response
Class PeriodsResponse<T extends AbstractPeriod>
- java.lang.Object
-
- com.aerisweather.aeris.response.AerisFriendlyResponse
-
- com.aerisweather.aeris.response.PeriodsResponse<T>
-
- Type Parameters:
T
- Type of period to use
- Direct Known Subclasses:
ConditionsResponse
,ConditionsSummaryResponse
,ForecastsResponse
,NormalsResponse
,ObArchiveResponse
,ObSummaryResponse
,TidesResponse
public class PeriodsResponse<T extends AbstractPeriod> extends AerisFriendlyResponse
Helper class that handles accessing period information from specific responses
-
-
Constructor Summary
Constructors Constructor Description PeriodsResponse(AerisDataJSON data, Class<T> clazz)
Period response constructor that needs
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getPeriod(int index)
Get a period from the listList<T>
getPeriods()
Gets the list of the periods.int
getPeriodsSize()
Get the number of periods-
Methods inherited from class com.aerisweather.aeris.response.AerisFriendlyResponse
getDataSource, getId, getLocation, getPlace, getProfile, getProfileTimezone, getRelative
-
-
-
-
Field Detail
-
periods
protected List<T extends AbstractPeriod> periods
List of periods
-
clazz
protected Class<T extends AbstractPeriod> clazz
The class type used to instantiate a type of the generic
-
-
Constructor Detail
-
PeriodsResponse
public PeriodsResponse(AerisDataJSON data, Class<T> clazz)
Period response constructor that needs- Parameters:
data
- data to pass to the AerisFriendlyResponseclazz
- the class type of the AbstractPeriod to be able to instantiate the generic
-
-
Method Detail
-
getPeriods
public List<T> getPeriods()
Gets the list of the periods.- Returns:
- The list of the Period.
-
getPeriodsSize
public int getPeriodsSize()
Get the number of periods- Returns:
- the number of periods.
-
getPeriod
public T getPeriod(int index)
Get a period from the list- Parameters:
index
- to grab from the list of periods.- Returns:
- The period
-
-