Package

macrame.play

enums

Permalink

package enums

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. enums
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait AsJson[Enum] extends AnyRef

    Permalink

    This trait provides an instance of Writes for an enumeration.

    This trait provides an instance of Writes for an enumeration. It works by extending the companion object of the enumeration class.

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends AsJson[Color]
  2. trait FromJson[Enum] extends AnyRef

    Permalink

    This trait provides an instance of Reads for an enumeration.

    This trait provides an instance of Reads for an enumeration. It works by extending the companion object of the enumeration class.

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends FromJson[Color]

    If you need your Reads instance to be case-insensitive you can override the caseSensitive member like so:

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends FromJson[Color] {
      override val caseSensitive = false
    }
  3. trait FromJsonNumeric[Enum] extends AnyRef

    Permalink

    This trait provides an instance of Reads for an enumeration.

    This trait provides an instance of Reads for an enumeration. Unlike FromJson, the Reads instance created by this trait operates on JsNumber using the Int representation of the enumeration. It works by extending the companion object of the enumeration class.

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends FromJsonNumeric[Color]

    Allows you to read JSON numbers as Color like so:

    JsNumber(0).validate[Color] // JsResult(Red)
  4. trait JsonConverters[Enum] extends AsJson[Enum] with FromJson[Enum]

    Permalink

    This trait provides an instance of Format for an enumeration.

    This trait provides an instance of Format for an enumeration. It works by extending the companion object of the enumeration class.

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends JsonConverters[Color]

    If you need your Format instance to be case-insensitive you can override the caseSensitive member like so:

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends JsonConverters[Color] {
      override val caseSensitive = false
    }
  5. trait PathConverters[Enum] extends AnyRef

    Permalink

    This trait provides an instance of PathBindable for an enumeration.

    This trait provides an instance of PathBindable for an enumeration. It works by extending the companion object of the enumeration class.

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends PathBindable[Color]

    If you need your PathBindable instance to be case-insensitive you can override the caseSensitive member like so:

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends PathConverters[Color] {
      override val caseSensitive = false
    }
  6. trait PathNumericConverters[Enum] extends AnyRef

    Permalink

    This trait provides an instance of PathBindable for an enumeration.

    This trait provides an instance of PathBindable for an enumeration. Unlike PathConverters, the PathBindable instance created by this trait treats the input as a number using the Int representation of the enumeration. It works by extending the companion object of the enumeration class.

    @enum class Digit {
      Zero
      One
      Two
      Three
      Four
      Five
      Six
      Seven
      Eight
      Nine
    }
    object Digit extends PathNumericConverters[Digit]
  7. trait QueryStringConverters[Enum] extends AnyRef

    Permalink

    This trait provides an instance of QueryStringBindable for an enumeration.

    This trait provides an instance of QueryStringBindable for an enumeration. It works by extending the companion object of the enumeration class.

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends QueryStringConverters[Color]

    If you need your QueryStringBindable instance to be case-insensitive you can override the caseSensitive member like so:

    @enum class Color {
      Red
      Blue
      Yellow
    }
    object Color extends QueryStringConverters[Color] {
      override val caseSensitive = false
    }
  8. trait QueryStringNumericConverters[Enum] extends AnyRef

    Permalink

    This trait provides an instance of QueryStringBindable for an enumeration.

    This trait provides an instance of QueryStringBindable for an enumeration. Unlike QueryStringConverters, the QueryStringBindable instance created by this trait treats the input as a number using the Int representation of the enumeration. It works by extending the companion object of the enumeration class.

    @enum class Digit {
      Zero
      One
      Two
      Three
      Four
      Five
      Six
      Seven
      Eight
      Nine
    }
    object Digit extends QueryStringNumericConverters[Digit]

Inherited from AnyRef

Inherited from Any

Ungrouped