enumeratum
Members list
Type members
Classlikes
Created by Lloyd on 2/3/15.
Created by Lloyd on 2/3/15.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- Forms.type
An Enum that has a lot of the Play-related implicits built-in so you can avoid boilerplate.
An Enum that has a lot of the Play-related implicits built-in so you can avoid boilerplate.
Note, the binders created here are case-sensitive.
Things included are:
- implicit JSON format
- implicit PathBindable (for binding from request path)
- implicit QueryStringBindable (for binding from query strings)
- formField for doing things like
Form("hello" -> MyEnum.formField)
Example:
scala> import enumeratum._
scala> import play.api.data.Form
scala> import play.api.libs.json._
scala> sealed trait Greeting extends EnumEntry
scala> object Greeting extends PlayEnum[Greeting] {
| val values = findValues
| case object Hello extends Greeting
| case object GoodBye extends Greeting
| case object Hi extends Greeting
| case object Bye extends Greeting
| }
scala> val form = Form("greeting" -> Greeting.formField)
scala> form.bind(Map("greeting" -> "Hello")).value
res0: Option[Greeting] = Some(Hello)
scala> Json.toJson(Greeting.Hello) res1: JsValue = "Hello"
Attributes
- Graph
- Supertypes
- trait PlayFormFieldEnum[A]trait PlayQueryBindableEnum[A]trait PlayPathBindableEnum[A]trait PlayJsonEnum[A]trait Enum[A]class Objecttrait Matchableclass Any
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayEnum[A]
- Self type
- Enum[A]
An Enum that has a lot of the Play-related implicits built-in so you can avoid boilerplate.
An Enum that has a lot of the Play-related implicits built-in so you can avoid boilerplate.
Note, the binders created here transform to lower case.
Things included are:
- implicit JSON format
- implicit PathBindable (for binding from request path)
- implicit QueryStringBindable (for binding from query strings)
- formField for doing things like
Form("hello" -> MyEnum.formField)
Attributes
- Graph
- Supertypes
- trait PlayLowercaseFormFieldEnum[A]trait PlayLowercaseQueryBindableEnum[A]trait PlayLowercasePathBindableEnum[A]trait PlayLowercaseJsonEnum[A]trait Enum[A]class Objecttrait Matchableclass Any
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayLowercaseEnum[A]
- Self type
- Enum[A]
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayLowercaseEnum[A]
- Self type
- Enum[A]
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayLowercaseEnum[A]
- Self type
- Enum[A]
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayEnum[A]
- Self type
- Enum[A]
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayEnum[A]
- Self type
- Enum[A]
An Enum that has a lot of the Play-related implicits built-in so you can avoid boilerplate.
An Enum that has a lot of the Play-related implicits built-in so you can avoid boilerplate.
Note, the binders created here transform to upper case.
Things included are:
- implicit JSON format
- implicit PathBindable (for binding from request path)
- implicit QueryStringBindable (for binding from query strings)
- formField for doing things like
Form("hello" -> MyEnum.formField)
Attributes
- Graph
- Supertypes
- trait PlayUppercaseFormFieldEnum[A]trait PlayUppercaseQueryBindableEnum[A]trait PlayUppercasePathBindableEnum[A]trait PlayUppercaseJsonEnum[A]trait Enum[A]class Objecttrait Matchableclass Any
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayUppercaseEnum[A]
- Self type
- Enum[A]
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayUppercaseEnum[A]
- Self type
- Enum[A]
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- trait PlayUppercaseEnum[A]
- Self type
- Enum[A]
Created by Lloyd on 2/3/15.
Created by Lloyd on 2/3/15.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- UrlBinders.type