macrame.enums
This trait provides conversion from an enumeration to Long. It works by extending the companion object of the enumeration class.
@enum class Color { Red Blue Yellow } object Color extends AsLong[Color]
This enables the following two ways to convert Color to a Long.
Color
Long
Red.asLong Color.asLong(Red) // returns 0l
This trait provides conversion from an enumeration to Long. It works by extending the companion object of the enumeration class.
This enables the following two ways to convert
Color
to aLong
.Red.asLong Color.asLong(Red) // returns 0l