added builder sample

This commit is contained in:
Ilkka Seppala
2014-08-09 22:38:07 +03:00
parent 959a1f63ba
commit a4b58fe06e
9 changed files with 272 additions and 0 deletions

View File

@@ -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;
}
}