IntPlayPathBindableValueEnum

enumeratum.values.IntPlayPathBindableValueEnum
trait IntPlayPathBindableValueEnum[EntryType <: IntEnumEntry] extends PlayPathBindableValueEnum[Int, EntryType]

Path Bindable implicits for IntEnum

Attributes

Graph
Supertypes
trait PlayPathBindableValueEnum[Int, EntryType]
class Object
trait Matchable
class Any
Known subtypes
trait IntPlayEnum[EnumEntry]
Self type
IntEnum[EntryType]

Members list

Value members

Inherited fields

lazy val fromPath: PathBindableExtractor[EntryType]

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>

Attributes

Inherited from:
PlayPathBindableValueEnum

Implicits

Implicits

implicit val pathBindable: PathBindable[EntryType]

Implicit path binder for Play's default router

Implicit path binder for Play's default router

Attributes