I have an an array which I can get the string name from.
arr[i].getName();
I want a way to compare this to a number of strings I currently have them them in an Enum as follows:
public enum BlockManValEnum {
SecurityID("SecurityID"),
BlockStatus("BlockStatus"),
Side("Side"),
GTBookingInst("GTBookingInst");
private String name;
private BlockManValEnum(String name) {
this.name = name;
}
public String toString() {
return this.name;
}
}
I want a way to check the element in the array if it matches one of these attributes then perform extra functionallity if it does not match do not worry about it. I know enum is the total wrong way to store this.
However. The only way I can think around this is to create a map with a String key which will just return a true boolean. (this seems kinda dirty)
here is how you could use this: