I created the Scala enumeration as follows:
object TimerStatus extends Enumeration {
type Status = Value
val InProgress = Value(1, "Pause Timer")
val Paused = Value(-1, "Resume Timer")
}
Then I have a Match class that contains TimerStatus as a member
How can I return the text “Pause timer” or “Resume timer” from my enumeration values?
I can get the id using myMatch.timerStatus.id, but I see no way to getname
If this is not possible, what is the best way to do this?
source
share