mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 04:59:24 +00:00
bc060309e3
Makes it more readable and deletes an useless semicolon.
22 lines
350 B
Java
22 lines
350 B
Java
package com.iluwatar;
|
|
|
|
public enum Action {
|
|
|
|
HUNT, TALE, GOLD, ENEMY;
|
|
|
|
public String toString() {
|
|
|
|
switch (this) {
|
|
case ENEMY:
|
|
return "spotted enemies";
|
|
case GOLD:
|
|
return "found gold";
|
|
case HUNT:
|
|
return "hunted a rabbit";
|
|
case TALE:
|
|
return "tells a tale";
|
|
}
|
|
return "";
|
|
}
|
|
}
|