Package

enumeratum

Permalink

package enumeratum

Visibility
  1. Public
  2. All

Type Members

  1. trait Enum[A <: EnumEntry] extends AnyRef

    Permalink

    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.

    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)
    A

    The sealed trait

  2. abstract class EnumEntry extends AnyRef

    Permalink

    Base type for an enum entry for Enum

    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

Value Members

  1. object Enum

    Permalink
  2. object EnumEntry

    Permalink
  3. package values

    Permalink

Ungrouped