p
enumeratum
package enumeratum
Ordering
- Alphabetic
Visibility
- Public
- Protected
Type Members
- trait Enum[A <: EnumEntry] extends EnumCompat[A]
All the cool kids have their own Enumeration implementation, most of which try to do so in the name of implementing exhaustive pattern matching.
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.
Example:
scala> import enumeratum._ scala> sealed trait DummyEnum extends EnumEntry scala> object DummyEnum extends Enum[DummyEnum] { | val values = findValues | case object Hello extends DummyEnum | case object GoodBye extends DummyEnum | case object Hi extends DummyEnum | } scala> DummyEnum.withNameOption("Hello") res0: Option[DummyEnum] = Some(Hello) scala> DummyEnum.withNameOption("Nope") res1: Option[DummyEnum] = None
- A
The sealed trait
- trait EnumEntry extends AnyRef
Base type for an enum entry for Enum
- final case class NoSuchMember[A <: EnumEntry](notFoundName: String, enumValues: IndexedSeq[A]) extends NoSuchElementException with NoStackTrace with Product with Serializable