[refactor] Update HairType enum in builder pattern.
This commit is contained in:
parent
8980b3958c
commit
300c8dfad4
@ -2,11 +2,16 @@ package com.iluwatar;
|
|||||||
|
|
||||||
public enum HairType {
|
public enum HairType {
|
||||||
|
|
||||||
BALD, SHORT, CURLY, LONG_STRAIGHT, LONG_CURLY;
|
BALD("bald"), SHORT("short"), CURLY("curly"), LONG_STRAIGHT("long straight"), LONG_CURLY("long curly");
|
||||||
|
|
||||||
@Override
|
private String title;
|
||||||
|
|
||||||
|
HairType(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name().toLowerCase().replaceAll("_", " ");
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user