trait ShortPlayEnum[EnumEntry <: ShortEnumEntry] extends ShortEnum[EnumEntry] with ShortPlayPathBindableValueEnum[EnumEntry] with ShortPlayQueryBindableValueEnum[EnumEntry] with ShortPlayFormValueEnum[EnumEntry] with ShortPlayJsonValueEnum[EnumEntry]
A ShortEnum that has a lot of the Play-related implicits built-in so you can avoid boilerplate.
Things included are:
- implicit PathBindable (for binding from request path)
- implicit QueryStringBindable (for binding from query strings)
- formField for doing things like
Form("hello" -> MyEnum.formField) - implicit Json format
See IntPlayEnum for example usage.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- ShortPlayEnum
- ShortPlayJsonValueEnum
- PlayJsonValueEnum
- ShortPlayFormValueEnum
- PlayFormValueEnum
- ShortPlayQueryBindableValueEnum
- PlayQueryBindableValueEnum
- ShortPlayPathBindableValueEnum
- PlayPathBindableValueEnum
- ShortEnum
- ShortEnumCompat
- ValueEnum
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Abstract Value Members
- abstract def values: IndexedSeq[EnumEntry]
- Definition Classes
- ValueEnum
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val baseFormatter: Formatter[Short]
The Formatter for binding the ValueType of this ValueEnum.
The Formatter for binding the ValueType of this ValueEnum.
Used for building the Formatter for the entries
- Attributes
- protected
- Definition Classes
- ShortPlayFormValueEnum → PlayFormValueEnum
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- macro def findValues: IndexedSeq[EnumEntry]
- Attributes
- protected
- Definition Classes
- ShortEnumCompat
- lazy val formField: Mapping[EnumEntry]
Field for mapping this enum in Forms
Field for mapping this enum in Forms
- Definition Classes
- PlayFormValueEnum
- implicit val format: Format[EnumEntry]
- Definition Classes
- ShortPlayJsonValueEnum → PlayJsonValueEnum
- lazy val fromPath: PathBindableExtractor[EnumEntry]
Binder for play.api.routing.sird router
Binder for play.api.routing.sird router
Example:
scala> import play.api.routing.sird._ scala> import play.api.routing._ scala> import play.api.mvc._ scala> sealed abstract class Greeting(val value: Int) extends IntEnumEntry scala> object Greeting extends IntPlayEnum[Greeting] { | val values = findValues | case object Hello extends Greeting(1) | case object GoodBye extends Greeting(2) | case object Hi extends Greeting(3) | case object Bye extends Greeting(4) | } scala> val router = Router.from { | case GET(p"/hello/${Greeting.fromPath(greeting)}") => Action { | Results.Ok(s"$greeting") | } | } scala> router.routes res0: Router.Routes = <function1>
- Definition Classes
- PlayPathBindableValueEnum
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- implicit val pathBindable: PathBindable[EnumEntry]
Implicit path binder for Play's default router
Implicit path binder for Play's default router
- Definition Classes
- ShortPlayPathBindableValueEnum → PlayPathBindableValueEnum
- implicit val queryBindable: QueryStringBindable[EnumEntry]
Implicit path binder for Play's default router
Implicit path binder for Play's default router
- Definition Classes
- ShortPlayQueryBindableValueEnum → PlayQueryBindableValueEnum
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final lazy val valuesToEntriesMap: Map[Short, EnumEntry]
- Definition Classes
- ValueEnum
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withValue(i: Short): EnumEntry
- Definition Classes
- ValueEnum
- Annotations
- @SuppressWarnings()
- def withValueEither(i: Short): Either[NoSuchMember[Short, ValueEnumEntry[Short]], EnumEntry]
- Definition Classes
- ValueEnum
- def withValueOpt(i: Short): Option[EnumEntry]
- Definition Classes
- ValueEnum
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
- Deprecated