Class WeatherCache
java.lang.Object
org.silverpeas.looks.aurora.service.weather.WeatherCache
Cache of weather forecast data coming from a weather service.
- Author:
- mmoquillon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal WeatherForecastDataget(String cityId, Supplier<WeatherForecastData> supplier) Gets the weather forecast data from the cache or invokes the specified supplier if no such data are in the cache or if the data is expired.
-
Constructor Details
-
WeatherCache
public WeatherCache()
-
-
Method Details
-
get
Gets the weather forecast data from the cache or invokes the specified supplier if no such data are in the cache or if the data is expired. If the supplier is invoked, the returned data is then automatically cached.- Parameters:
cityId- the unique identifier of a city.supplier- a supplier ofWeatherForecastDatainstance.- Returns:
- a
WeatherForecastDatainstance.
-