Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java check if enum contains value

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")
Comment

PREVIOUS NEXT
Code Example
Java :: java datetime now 
Java :: java example 
Java :: 2d arraylist in java 
Java :: how to make a string lowercase in java 
Java :: valueof vs tostring 
Java :: parse string to int java 
Java :: java variables in annotations 
Java :: initialize hashset with values java 9 
Java :: how to change label text color javafx 
Java :: how to use input in java 
Java :: inorder, PreOrder, PostOrder java 
Java :: reverse array java 
Java :: jpa default value enum 
Java :: convert fahrenheit to celsius 
Java :: android studio listview arrayadapter 
Java :: printing prime numbers in java 
Java :: flow dependency android 
Java :: android list[i] 
Java :: java % 
Java :: find min in array java 
Java :: double to string java 
Java :: how to find a word in string in java 
Java :: java check if number is in range 
Java :: How to determine if a graph contains a cycle, in Java? 
Java :: string vs stringbuffer 
Java :: get frequency of letters java 
Java :: java quick sort 
Java :: charat(0).touppercase() java 
Java :: Java Creating a Vector 
Java :: java long to integer 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =