Java Sprawdź, czy enum zawiera wartość

The EnumUtils class has a method called isValidEnum whichChecks if the specified name is a valid enum for the class. It returns a boolean true if the String is contained in the Enum class, and a boolean false otherwise.



EnumUtils.isValidEnum(Day.class, "MONDAY")
Delta Sierra