I want to have a Java enum whose values are integers.
For example:
public enum TaskStatus {
TaskCreated(1),
TaskDeleted(2)
}
But I also want custom names for these two constants like
e.g. "Task Created" and "Task Deleted" (with spaces there).
I want to do it as elegantly as possible without writing
too much additional code.
Can I achieve this without an additional map which
maps the enum constants to their custom names?
I am using JDK 6 in this project.
TaskStatuswithTASK_CREATED&TASK_DELETED.