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