macrame.enums
This trait provides conversion from Short to an enumeration. It works by extending the companion object of the enumeration class.
@enum class Color { Red Blue Yellow } object Color extends FromShort[Color]
This creates the following function to convert Short to Option[Color].
Short
Option[Color].
Color.fromShort(0 : Short) // returns Some(Red)
This trait provides conversion from Short to an enumeration. It works by extending the companion object of the enumeration class.
This creates the following function to convert
ShorttoOption[Color].