From e1eb03c622f7ba0ad29f7cc3f84066a85b3cdbba Mon Sep 17 00:00:00 2001 From: Martin Eyben Date: Mon, 4 Nov 2024 10:49:40 +0100 Subject: [PATCH] doc(weatherAPI): add few documentation --- src/main/java/eirb/pg203/Temperature.java | 12 ++++++++++++ src/main/java/eirb/pg203/WeatherDataAPI.java | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/main/java/eirb/pg203/Temperature.java b/src/main/java/eirb/pg203/Temperature.java index 5089bb6..b83cc98 100644 --- a/src/main/java/eirb/pg203/Temperature.java +++ b/src/main/java/eirb/pg203/Temperature.java @@ -13,14 +13,26 @@ public class Temperature { this.date = date; } + /** + * Get the name of the city from where the temperature come from + * @return city + */ public String getCity() { return city; } + /** + * Get the date + * @return date + */ public Instant getDate() { return date; } + /** + * Get the temperature + * @return temperature + */ public float getTemp() { return temp; } diff --git a/src/main/java/eirb/pg203/WeatherDataAPI.java b/src/main/java/eirb/pg203/WeatherDataAPI.java index a982cf2..d76802c 100644 --- a/src/main/java/eirb/pg203/WeatherDataAPI.java +++ b/src/main/java/eirb/pg203/WeatherDataAPI.java @@ -5,11 +5,30 @@ import java.util.ArrayList; public interface WeatherDataAPI { + /** + * Fetch the temperature for a specific day in a city + * @param day Since D+0 + * @param city Localisation + * @return Temperature of the day from the city + * @throws IOException when request failed + */ Temperature getTemperature(int day, String city) throws IOException; + /** + * + * @param day Since D+0 + * @param hour Since H+0 + * @param city Localisation + * @return Temperature of the day for a hour from the city + * @throws IOException when request failed + */ Temperature getTemperature(int day, int hour, String city) throws IOException; ArrayList getTemperatures(int days, String city) throws IOException; + /*** + * Name of the API + * @return Name of the API + */ String getAPIName(); }