I have a Scala Enumeration and I want to get the Enumeration value from String
.
object CVVStatus extends Enumeration {
type CVVStatus = Value
val PRESENT, NOT_PRESENT, VALID, INVALID = Value
}
I want to do something like this:
val prop = new Properties()
prop.load(new FileInputStream("config.conf"))
val tmp = prop.getProperty(propname)
val s:CVVStatus = StringtoEmum(tmp)
If I need lots of enumeration from different Enumeration object-name to enumeration objects, how should I accomplish this? What package should I import?