From 2a3d5eaa11c9e7f6347350977acce7bf0f326645 Mon Sep 17 00:00:00 2001 From: TiagoRG <35657250+TiagoRG@users.noreply.github.com> Date: Thu, 4 May 2023 15:44:17 +0100 Subject: [PATCH] [POO] added OTHER to MeatType --- 1ano/2semestre/poo/src/aula08/ex2/Enums/MeatType.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/1ano/2semestre/poo/src/aula08/ex2/Enums/MeatType.java b/1ano/2semestre/poo/src/aula08/ex2/Enums/MeatType.java index ff9f6dc..ffdf55f 100644 --- a/1ano/2semestre/poo/src/aula08/ex2/Enums/MeatType.java +++ b/1ano/2semestre/poo/src/aula08/ex2/Enums/MeatType.java @@ -1,7 +1,7 @@ package aula08.ex2.Enums; public enum MeatType { - COW, PORK, TURKEY, CHICKEN; + COW, PORK, TURKEY, CHICKEN, OTHER; public static MeatType fromString(String string) { return switch (string.toUpperCase()) { @@ -9,7 +9,7 @@ public enum MeatType { case "PORK" -> PORK; case "TURKEY" -> TURKEY; case "CHICKEN" -> CHICKEN; - default -> null; + default -> OTHER; }; } @@ -20,6 +20,7 @@ public enum MeatType { case PORK -> "PORK"; case TURKEY -> "TURKEY"; case CHICKEN -> "CHICKEN"; + default -> "OTHER"; }; } }