The values in my enum are words that need to have spaces in them, but enums can\'t have spaces in their values so it\'s all bunched up. I want to override
enum
The following is a nice generic alternative to valueOf()
public static RandomEnum getEnum(String value) { for (RandomEnum re : RandomEnum.values()) { if (re.description.compareTo(value) == 0) { return re; } } throw new IllegalArgumentException("Invalid RandomEnum value: " + value); }