trait BytePlayEnum[EnumEntry <: ByteEnumEntry] extends ByteEnum[EnumEntry] with BytePlayPathBindableValueEnum[EnumEntry] with BytePlayQueryBindableValueEnum[EnumEntry] with BytePlayFormValueEnum[EnumEntry] with BytePlayJsonValueEnum[EnumEntry]
A ByteEnum 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 QueryByteBindable (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
- BytePlayEnum
- BytePlayJsonValueEnum
- PlayJsonValueEnum
- BytePlayFormValueEnum
- PlayFormValueEnum
- BytePlayQueryBindableValueEnum
- PlayQueryBindableValueEnum
- BytePlayPathBindableValueEnum
- PlayPathBindableValueEnum
- ByteEnum
- ValueEnum
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
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[Byte]
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
- BytePlayFormValueEnum → PlayFormValueEnum
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final macro
def
findValues: IndexedSeq[EnumEntry]
- Attributes
- protected
- Definition Classes
- ByteEnum
-
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
- BytePlayJsonValueEnum → 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[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
implicit
val
pathBindable: PathBindable[EnumEntry]
Implicit path binder for Play's default router
Implicit path binder for Play's default router
- Definition Classes
- BytePlayPathBindableValueEnum → PlayPathBindableValueEnum
-
implicit
val
queryBindable: QueryStringBindable[EnumEntry]
Implicit path binder for Play's default router
Implicit path binder for Play's default router
- Definition Classes
- BytePlayQueryBindableValueEnum → PlayQueryBindableValueEnum
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
lazy val
valuesToEntriesMap: Map[Byte, EnumEntry]
- Definition Classes
- ValueEnum
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withValue(i: Byte): EnumEntry
- Definition Classes
- ValueEnum
- Annotations
- @SuppressWarnings()
-
def
withValueEither(i: Byte): Either[NoSuchMember[Byte, ValueEnumEntry[Byte]], EnumEntry]
- Definition Classes
- ValueEnum
-
def
withValueOpt(i: Byte): Option[EnumEntry]
- Definition Classes
- ValueEnum