All the cool kids have their own Enumeration implementation, most of which try to do so in the name of implementing exhaustive pattern matching.
This is yet another one.
How to use:
sealed trait DummyEnum object DummyEnum extends Enum[DummyEnum] { val values = findValues case object Hello extends DummyEnum case object GoodBye extends DummyEnum case object Hi extends DummyEnum } DummyEnum.values should be(Set(Hello, GoodBye, Hi)) DummyEnum.withName("Hello") should be(Hello)
The sealed trait
Base type for an enum entry for Enum
By default, the entryName method used for serialising and deseralising Enum values uses toString, but feel free to override to fit your needs.
Mix in the supplied stackable traits to convert the entryName to Snakecase, Uppercase, and Lowercase
All the cool kids have their own Enumeration implementation, most of which try to do so in the name of implementing exhaustive pattern matching.
This is yet another one.
How to use:
The sealed trait