Say I have an enum which is just
public enum Blah { A, B, C, D }
and I would like to find the enum value of a string, for example
public static MyEnum getFromValue(String value) { MyEnum resp = null; MyEnum nodes[] = values(); for(int i = 0; i < nodes.length; i++) { if(nodes[i].value.equals(value)) { resp = nodes[i]; break; } } return resp; }