diff --git a/Weather_App.svg b/Weather_App.svg
index 832b973..9879a79 100644
--- a/Weather_App.svg
+++ b/Weather_App.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/diagram_class.puml b/diagram_class.puml
index a140409..604bad3 100644
--- a/diagram_class.puml
+++ b/diagram_class.puml
@@ -16,8 +16,8 @@ package eirb.pg203.weather {
}
class WeatherDataCache {
- + private HashMap {final} cache
- + private long {static} {final} cacheTTL
+ - private HashMap cache
+ - private long cacheTTL
+ boolean has(String cityName, int day)
+ boolean needsUpdate(String cityName, int day)
+ void set(String cityName, int day, WeatherData value, Instant timestamp)
@@ -26,7 +26,7 @@ package eirb.pg203.weather {
}
abstract class WeatherCachedAPI implements WeatherDataAPI {
- ~ WeatherDataCache {final} cache
+ - private WeatherDataCache cache
+ JSONArray toJSON()
+ void loadCache(JSONArray data)
+ void loadCacheFromFile(String path)
@@ -35,13 +35,13 @@ package eirb.pg203.weather {
}
Class OpenMeteo extends WeatherCachedAPI {
- - String {final} forecastBaseUrl
- - String {final} daylyQuery
+ - String forecastBaseUrl
+ - String daylyQuery
~ JSONFetcher JSONFetcher
~ Clock clock
- JSONObject fetchWeather(int days, City city)
- Condition {static} getConditionFromCode(int WMOCode)
- - WeatherData getWeatherDataFromForecast(JSONObject response, int day, String city)
+ - ArrayList getWeatherDataFromForecast(JSONObject response, int day, String city)
}
Class OpenWeatherMap extends WeatherCachedAPI {
diff --git a/src/main/java/eirb/pg203/weather/data/api/WeatherDataCache.java b/src/main/java/eirb/pg203/weather/data/api/WeatherDataCache.java
index 429cfcf..30169ba 100644
--- a/src/main/java/eirb/pg203/weather/data/api/WeatherDataCache.java
+++ b/src/main/java/eirb/pg203/weather/data/api/WeatherDataCache.java
@@ -60,7 +60,7 @@ public class WeatherDataCache {
}
private final HashMap cache = new HashMap<>();
- private static final long cacheTTL = 3600; // Cache data Time To Live in sec
+ private final long cacheTTL = 3600; // Cache data Time To Live in sec
private String makeKey(String cityName, int day) {
return String.format(Locale.ENGLISH, "%s%d", cityName, day);