Skip to content

Commit

Permalink
[refactor] Update Action enum in mediator pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslanpa committed Feb 9, 2015
1 parent c23f58e commit 5b81a88
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions mediator/src/main/java/com/iluwatar/Action.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@
*/
public enum Action {

HUNT, TALE, GOLD, ENEMY;
HUNT("hunted a rabbit"), TALE("tells a tale"), GOLD("found gold"), ENEMY("spotted enemies"), NONE("");

public String toString() {
private String title;

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 "";
Action(String title) {
this.title = title;
}

public String toString() {
return title;
}
}

0 comments on commit 5b81a88

Please sign in to comment.