It really depends on what you want to do with the returned value:
name()
as toString
may have been overridentoString
which may have been overriden (or not!).When I feel that it might be confusing, I provide a more specific getXXX
method, for example:
public enum Fields {
LAST_NAME("Last Name"), FIRST_NAME("First Name");
private final String fieldDescription;
private Fields(String value) {
fieldDescription = value;
}
public String getFieldDescription() {
return fieldDescription;
}
}
~ Answered on 2012-11-08 14:37:43