public static Integer intValue(String value) { for (BioSafetyOption option : BioSafetyOption.values()) { if (option.displayName.equalsIgnoreCase(value) || option.getValue().equals(value)) { return Integer.valueOf(option.getValue()); } } return null; }
public static boolean isValidOption(Integer integer) { if (integer == null) return false; for (BioSafetyOption option : BioSafetyOption.values()) { Integer intValue = intValue(option.toString()); if (intValue != null && integer.intValue() == intValue) return true; } return false; }