Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bd4cecd

Browse filesBrowse files
committed
[refactor] Update Armor enum in builder pattern.
1 parent 6f59f25 commit bd4cecd
Copy full SHA for bd4cecd

1 file changed

+9-4Lines changed: 9 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎builder/src/main/java/com/iluwatar/Armor.java‎

Copy file name to clipboardExpand all lines: builder/src/main/java/com/iluwatar/Armor.java
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
public enum Armor {
44

5-
CLOTHES, LEATHER, CHAIN_MAIL, PLATE_MAIL;
5+
CLOTHES("clothes"), LEATHER("leather"), CHAIN_MAIL("chain mail"), PLATE_MAIL("plate mail");
66

7-
@Override
7+
private String title;
8+
9+
Armor(String title) {
10+
this.title = title;
11+
}
12+
13+
@Override
814
public String toString() {
9-
return name().toLowerCase().replaceAll("_", " ");
15+
return title;
1016
}
11-
1217
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.