I’m reading configuration from an xml file. I have a property called linkType in my configuration. I have equivalent enum class in my project which declares two types of link.
How can I set enum type from String? if I read EMPTY from configuration and if I have linkType.EMPTY declared enum how will I set this to EMPTY?
Because further in my code I have a switch statement on this enum but I can’t set it from configuration
Sounds like you’re looking for
Enum.valueOf.(Sorry about the imprecise link, can’t get the space in the URL to work.)