Sep 13, 2018

How to convert String to enum in Java

Use the valueOf() method of the enum class.

Such as YourEnum.valueOf("ABC") to convert the String "ABC" into corresponding Enum value.