You can achieve it but it will require a bit of work.
Read moreCan enum take string values?
There is no built-in method of declaring an enumeration with string values . If we want to declare an enumeration with string constants, we can use the enum class and an extension function to achieve this goal.
Read moreCan enum be using with string Java?
Java provides a valueOf(String) method for all enum types . Thus, we can always get an enum value based on the declared name: assertSame(Element.LI, Element.2 Eyl 2021
Read more