Grails

Groovy: Few ways to convert string into enum

Many at times, we have a string which needs to be converted into Enum. I will be sharing few options as stated by Mr.Haki, Isa Goksu and in the last the one I discovered during the process. Lets say we have a Enum AccountType as given below : [groovy] enum AccountType { CHECKING, SAVING } assert AccountType.CHECKING...

by Amit Jain
Tag: convert string to enum
15-Apr-2011