From 8e64742fde33a6001464803576c6cf83b3ce0eee Mon Sep 17 00:00:00 2001 From: Hammy Date: Wed, 9 Jun 2021 00:06:34 +0100 Subject: [PATCH] Add enum for seasons of the year Reduces the chance of user error to near 0 as they will choose from an enum instead of string --- src/main/java/me/goudham/util/Season.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/me/goudham/util/Season.java diff --git a/src/main/java/me/goudham/util/Season.java b/src/main/java/me/goudham/util/Season.java new file mode 100644 index 0000000..e44a2b8 --- /dev/null +++ b/src/main/java/me/goudham/util/Season.java @@ -0,0 +1,22 @@ +package me.goudham.util; + +/** + * Listing all 4 {@link Season}'s + * + */ +public enum Season { + SPRING("spring"), + SUMMER("summer"), + FALL("fall"), + WINTER("winter"); + + private final String season; + + Season(String season) { + this.season = season; + } + + public String getSeason() { + return season; + } +}