/** * Check whether the given array of enum constants contains a constant with the given name, * ignoring case when determining a match. * * @param enumValues the enum values to check, typically the product of a call to MyEnum.values() * @param constant the constant name to find (must not be null or empty string) * @return whether the constant has been found in the given array */ public static boolean containsConstant(Enum<?>[] enumValues, String constant) { return containsConstant(enumValues, constant, false); }
/** * Check whether the given array of enum constants contains a constant with the given name, * ignoring case when determining a match. * * @param enumValues the enum values to check, typically the product of a call to MyEnum.values() * @param constant the constant name to find (must not be null or empty string) * @return whether the constant has been found in the given array */ public static boolean containsConstant(Enum<?>[] enumValues, String constant) { return containsConstant(enumValues, constant, false); }
/** * Check whether the given array of enum constants contains a constant with the given name, * ignoring case when determining a match. * * @param enumValues the enum values to check, typically the product of a call to MyEnum.values() * @param constant the constant name to find (must not be null or empty string) * @return whether the constant has been found in the given array */ public static boolean containsConstant(Enum<?>[] enumValues, String constant) { return containsConstant(enumValues, constant, false); }