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