From 8d6c6415acf56317bcf48bc45590413fd940b8ea Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Mon, 18 Nov 2024 16:46:21 +0000 Subject: [PATCH] Add interfaces for weather forecasting. Co-Authored-By: os222 --- src/main/java/ic/doc/WeatherForecast.java | 7 +++++++ src/main/java/ic/doc/WeatherForecaster.java | 5 +++++ src/main/java/ic/doc/WeatherRegion.java | 13 +++++++++++++ src/main/java/ic/doc/Weekday.java | 11 +++++++++++ 4 files changed, 36 insertions(+) create mode 100644 src/main/java/ic/doc/WeatherForecast.java create mode 100644 src/main/java/ic/doc/WeatherForecaster.java create mode 100644 src/main/java/ic/doc/WeatherRegion.java create mode 100644 src/main/java/ic/doc/Weekday.java diff --git a/src/main/java/ic/doc/WeatherForecast.java b/src/main/java/ic/doc/WeatherForecast.java new file mode 100644 index 0000000..6b6256a --- /dev/null +++ b/src/main/java/ic/doc/WeatherForecast.java @@ -0,0 +1,7 @@ +package ic.doc; + +public interface WeatherForecast { + String summary(); + + int temperature(); +} diff --git a/src/main/java/ic/doc/WeatherForecaster.java b/src/main/java/ic/doc/WeatherForecaster.java new file mode 100644 index 0000000..b48c74e --- /dev/null +++ b/src/main/java/ic/doc/WeatherForecaster.java @@ -0,0 +1,5 @@ +package ic.doc; + +public interface WeatherForecaster { + WeatherForecast forecastFor(WeatherRegion region, Weekday day); +} \ No newline at end of file diff --git a/src/main/java/ic/doc/WeatherRegion.java b/src/main/java/ic/doc/WeatherRegion.java new file mode 100644 index 0000000..4123336 --- /dev/null +++ b/src/main/java/ic/doc/WeatherRegion.java @@ -0,0 +1,13 @@ +package ic.doc; + +public enum WeatherRegion { + BIRMINGHAM, + EDINBURGH, + GLASGOW, + LONDON, + MANCHESTER, + NORTH_ENGLAND, + SOUTH_WEST_ENGLAND, + SOUTH_EAST_ENGLAND, + WALES +} diff --git a/src/main/java/ic/doc/Weekday.java b/src/main/java/ic/doc/Weekday.java new file mode 100644 index 0000000..c6a13a7 --- /dev/null +++ b/src/main/java/ic/doc/Weekday.java @@ -0,0 +1,11 @@ +package ic.doc; + +public enum Weekday { + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY, + SUNDAY +}