I have the following enum
that contains two values, a string identifier and a boolean valid status. I would like to be able to get the status value by using the string identifier.
Has anyone got any suggestions what I can add to the code below?
public enum MyEnum {
TYPEA("001", true),
TYPEB("002", false);
private final String identifier;
private final boolean valid;
MyEnum(String identifier, boolean valid) {
this.identifier = identifier;
this.valid = valid;
}
}