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,20 @@
package com.iluwatar;
public enum Weapon {
DAGGER, SWORD, AXE, WARHAMMER, BOW;
@Override
public String toString() {
String s = "";
switch(this) {
case DAGGER: s = "dagger"; break;
case SWORD: s = "sword"; break;
case AXE: s = "axe"; break;
case WARHAMMER: s = "warhammer"; break;
case BOW: s = "bow"; break;
}
return s;
}
}