Reputation: 9724
Given to following Enumeration
...
object TokenType extends Enumeration {
type TokenType = Value
val Activation = Value("activation")
val Authentication = Value("authentication")
val Reset = Value("reset")
}
... I get the a value as a string like this:
scala> val str = Reset.toString
str: String = reset
But how can I get a TokenType.Value
starting from the string reset
?
scala> val v: TokenType = ???
Thanks.
Upvotes: 1
Views: 813