diff --git a/command/src/main/java/com/iluwatar/Size.java b/command/src/main/java/com/iluwatar/Size.java index bdf9c5dca..d06210aad 100644 --- a/command/src/main/java/com/iluwatar/Size.java +++ b/command/src/main/java/com/iluwatar/Size.java @@ -1,32 +1,22 @@ package com.iluwatar; /** - * + * * Enumeration for target size. * */ public enum Size { - SMALL, NORMAL, LARGE; + SMALL("small"), NORMAL("normal"), LARGE("large"), UNDEFINED(""); + + private String title; - @Override + Size(String title) { + this.title = title; + } + + @Override public String toString() { - - String s = ""; - - switch (this) { - case LARGE: - s = "large"; - break; - case NORMAL: - s = "normal"; - break; - case SMALL: - s = "small"; - break; - default: - break; - } - return s; + return title; } } diff --git a/command/src/main/java/com/iluwatar/Visibility.java b/command/src/main/java/com/iluwatar/Visibility.java index 27f380c09..7fbdc4e44 100644 --- a/command/src/main/java/com/iluwatar/Visibility.java +++ b/command/src/main/java/com/iluwatar/Visibility.java @@ -7,24 +7,16 @@ package com.iluwatar; */ public enum Visibility { - VISIBLE, INVISIBLE; + VISIBLE("visible"), INVISIBLE("invisible"), UNDEFINED(""); - @Override + private String title; + + Visibility(String title) { + this.title = title; + } + + @Override public String toString() { - - String s = ""; - - switch (this) { - case INVISIBLE: - s = "invisible"; - break; - case VISIBLE: - s = "visible"; - break; - default: - break; - - } - return s; + return title; } }