@startuml title Weather App note "Getters, setters and constructors are not displayed" as N package eirb.pg203 { Interface WeatherDataAPI { + WeatherData getTemperature(int day, String city) + WeatherData getTemperature(int day, int hour, String city) + WeatherData getTemperatures(int days, String city) + String getAPIName() } Interface WeatherDisplay { + void display(int days, String city) + void addAPI(WeatherDataAPI w) } Exception exceptions.WeatherFeatchingException { } Exception exceptions.WeatherFeatchingExceptionApi extends exceptions.WeatherFeatchingException{ } Exception exceptions.WeatherFeatchingExceptionCityCoords extends exceptions.WeatherFeatchingException{ } Class utils.Coords { - float lat - float lon } Class utils.JSONFetcher { + fetch(URL url) - private {static} fetchString(URL url) } Class City { - String cityName - utils.Coords cityCoords ~ JSONFetcher JSONFetcher - private Coords getCoordsFromName(String cityName) + public String toString() } Class WeatherData { - City city - Instant date - float temp - Condition condition - float windSpeed - float windDirectionAngle - WindDirection windDirection + String toString() } Class WeatherDisplayBasic implements WeatherDisplay { - ArrayList apis - double getColumnSize() - void displayHeader(int days, double sourceColumnSize, double dayColumnSize) - void displayWeatherDatas(String apiName, ArrayList weatherDatas, String startColumnSize, double sourceColumnSize, double dayColumnSize) - void displaySeparatorLine(int days, double sourceColumnSize, double dayColumnSize) - void displayAllWeatherDatas() } Class OpenMeteo implements WeatherDataAPI { - String {final} forecastBaseUrl - String {final} daylyQuery ~ JSONFetcher JSONFetcher ~ Clock clock - JSONObject fetchWeather(int days, City city) - Condition {static} getConditionFromCode(int WMOCode) - WeatherData getWeatherDataFromForecast(JSONObject response, int day, String city) } Class OpenWeatherMap implements WeatherDataAPI { - String {static} forecastBaseUrl - String APIKey ~ Clock clock ~ JSONFetcher JSONFetcher - WeatherData getWeatherDataFromForecast(JSONObject response, int day, String city) - JSONObject fetchWeather(City city) } Class WeatherAPI implements WeatherDataAPI { - String APIKey - String {static} forecastBaseUrl ~ JSONFetcher JSONFetcher - JSONObject fetchWeather(int days, String city) - WeatherData.Condition {static} getConditionFromString(String str) - WeatherData {static} getWeatherDataFromForecast(JSONObject response, int day, String city) } } Exception Exception Exception <|-- WeatherFeatchingException @enduml