Is there any possible solution in scala. I've got Enum with Value, whose elements are of another enum.
object NumEnum extends Enumeration {
val EVEN = Value(TWO, FOUR, SIX)
val ODD = Value(ONE, THREE, FIVE)
val numbersByType = for {
nt <- NumberEnum.values
n <- nt.[here i wanna collection values but the only thing i can get is.id of enum]
} yield
...
class CustomVal(val nums: Num) extends Val
protected final def Value(nums: Num): CustomVal = new CustomVal(nums)
}
class Num extends Enumeration {
val ONE, TWO, THREE, FOUR, FIVE, SIX = Value
}
In java it's possible to getEnumConstants() and fill up Map of type . Is there any chance to do this in scala?