mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-12 02:14:07 +00:00
added command sample
This commit is contained in:
1 parent
f0e7f22266
commit
0785bccffb
11 files changed
+250
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package com.iluwatar;
|
||||
|
||||
public enum Size {
|
||||
|
||||
SMALL,
|
||||
NORMAL,
|
||||
LARGE;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user