Specifically using the new enum
keyword provided by Scala 3…
<code>enum Translation(bit: Byte) {
case FlipX extends Translation(1)
case FlipY extends Translation(2)
case RotateClockwise extends Translation(4) //90 degrees
}
</code>
<code>enum Translation(bit: Byte) {
case FlipX extends Translation(1)
case FlipY extends Translation(2)
case RotateClockwise extends Translation(4) //90 degrees
}
</code>
enum Translation(bit: Byte) {
case FlipX extends Translation(1)
case FlipY extends Translation(2)
case RotateClockwise extends Translation(4) //90 degrees
}
…What are the Scala 3 idiomatic style options to achieve the equivalent of Java’s java.util.EnumSet
and java.util.EnumMap
?
I’m explicitly excluding any Scala 2 style approaches, including Enumeratum.