Packages

p

com.micronautics

playUtils

package playUtils

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. playUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait JsonFormats extends AnyRef

Value Members

  1. def javaEnumFormat[E <: Enum[E]](implicit arg0: ClassTag[E]): Format[E]

    Create Play JSON Reads/Writes (Formatter) for any Java Enum.

    Create Play JSON Reads/Writes (Formatter) for any Java Enum. Use like this (the unit tests contain similar code):

    implicit val myEnumFormat = javaEnumFormat[MyEnum]
    Json.toJson(DiscountEnum.FullPrice) == "FullPrice"
    Json.fromJson[DiscountEnum](JsString("FullPrice")) == DiscountEnum.FullPrice
    See also

    [http://stackoverflow.com/a/34045056/553865]

  2. implicit object JsonFormatImplicits extends JsonFormats

Inherited from AnyRef

Inherited from Any

Ungrouped