mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 20:58:35 +00:00
added builder sample
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.iluwatar;
|
||||
|
||||
public enum Armor {
|
||||
|
||||
CLOTHES, LEATHER, CHAIN_MAIL, PLATE_MAIL;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String s = "";
|
||||
switch(this) {
|
||||
case CLOTHES: s = "clothes"; break;
|
||||
case LEATHER: s = "leather armor"; break;
|
||||
case CHAIN_MAIL: s = "chain mail"; break;
|
||||
case PLATE_MAIL: s = "plate mail"; break;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user