playframework - Scala Enumeration Val get value of -
in play application i'm using "activate-framework". enumerations have declare way:
object state extends enumeration { case class state(value: int) extends val(value) val open = state(0) val closed = state(1) }
source: http://activate-framework.org/documentation/entity/
how can state int like:
state.valueof(1) <==== ??
in model have field state:
import model.state.state case class task(var name:string, var state:state)
it state.state case class, how can convert int state.state class? when state(1) receive state.value not state.state class.
scala> state(1) res0: state.value = closed
Comments
Post a Comment