In this code I get a compiler error, see comment:
public enum Type {
CHANGESET(\"changeset\"),
NEW_TICKET(\"newticket\"),
TICKET_CHANGED(\"editedti
My own workaround, though it requires repeating all the enum values:
public enum Type {
CHANGESET,
NEW_TICKET,
TICKET_CHANGED,
CLOSED_TICKET;
private static final Map tracNameMap = new HashMap();
static {
tracNameMap.put("changeset", CHANGESET);
tracNameMap.put("newticket", NEW_TICKET);
tracNameMap.put("editedticket", TICKET_CHANGED);
tracNameMap.put("closedticket", CLOSED_TICKET);
}
public static Type getByTracName(String tn) {
return tracNameMap.get(tracNameMap);
}
}