Packages

case class JsonFormatBuilder[C <: HList, FC <: HList](fields: FC)(implicit aux: FormatterAux[C, FC]) extends Product with Serializable

A type-safe way to construct a JSONFormat by incrementally adding, removing or updating fields.

C

the type of the HList of fields currently in this builder

FC

the type of the HList of field definitions currently in this builder

fields

the fields currently in this builder

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsonFormatBuilder
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JsonFormatBuilder(fields: FC)(implicit aux: FormatterAux[C, FC])

    fields

    the fields currently in this builder

Type Members

  1. type ReadFunc[+A] = (C) ⇒ A
  2. type WriteFunc[-A] = (A) ⇒ C

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def customJsonFormat[A](preRead: (JsObject) ⇒ JsObject, readFunc: ReadFunc[A], writeFunc: WriteFunc[A], postWrite: (A, JsObject) ⇒ JsObject, errorHandler: (JsValue, Throwable) ⇒ A = defaultErrorHandler): RootJsonFormat[A]

    Returns a JSONFormat for objects of a type using the current list of fields defined and custom transformations.

    Returns a JSONFormat for objects of a type using the current list of fields defined and custom transformations.

    A

    the type of objects for which a JSONFormat is to be returned

    preRead

    a function transforming the JSON content before reads

    readFunc

    a function converting the list of fields to an instance of A

    writeFunc

    a function extracting the list of fields from an instance of A

    postWrite

    a function transforming the JSON content after writes

    errorHandler

    a function to catch and possibly recover from errors

    returns

    a JSONFormat for objects of type A.

  7. def customJsonReader[A](preRead: (JsObject) ⇒ JsObject, readFunc: ReadFunc[A], errorHandler: (JsValue, Throwable) ⇒ A = defaultErrorHandler): RootJsonReader[A]

    Returns a JSONReader for objects of a type using the current list of fields defined and custom transformations.

    Returns a JSONReader for objects of a type using the current list of fields defined and custom transformations.

    A

    the type of objects for which a JSONFormat is to be returned

    preRead

    a function transforming the JSON content before reads

    readFunc

    a function converting the list of fields to an instance of A

    errorHandler

    a function to catch and possibly recover from errors

    returns

    a JSONReader for objects of type A.

  8. def customJsonWriter[A](writeFunc: WriteFunc[A], postWrite: (A, JsObject) ⇒ JsObject): RootJsonWriter[A]

    Returns a JSONWriter for objects of a type using the current list of fields defined and custom transformations.

    Returns a JSONWriter for objects of a type using the current list of fields defined and custom transformations.

    A

    the type of objects for which a JSONFormat is to be returned

    writeFunc

    a function extracting the list of fields from an instance of A

    postWrite

    a function transforming the JSON content after writes

    returns

    a JSONWriter for objects of type A.

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def field[A](name: String, default: A, jf: JsonFormat[A])(implicit ev: AppenderAux[A, C, FC], dummy: DummyImplicit): JsonFormatBuilder[COut, FCOut]

    Adds a field to this builder.

    Adds a field to this builder.

    A

    the type of the new field

    name

    the name of the new field

    default

    the default value of the new field

    jf

    a JSONFormat to use in the new field

    returns

    a new instance of JsonFormatBuilder with the new field

  11. def field[A](name: String, default: A)(implicit jf: JsonFormat[A], ev: AppenderAux[A, C, FC]): JsonFormatBuilder[COut, FCOut]

    Adds a field to this builder.

    Adds a field to this builder.

    A

    the type of the new field

    name

    the name of the new field

    default

    the default value of the new field

    returns

    a new instance of JsonFormatBuilder with the new field

  12. def field[A](name: String)(implicit jf: JsonFormat[A], ev: AppenderAux[A, C, FC]): JsonFormatBuilder[COut, FCOut]

    Adds a field to this builder.

    Adds a field to this builder.

    A

    the type of the new field

    name

    the name of the new field

    returns

    a new instance of JsonFormatBuilder with the new field

  13. val fields: FC
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def jsonFormat[A](readFunc: ReadFunc[A], writeFunc: WriteFunc[A]): RootJsonFormat[A]

    Returns a JSONFormat for objects of a type using the current list of fields defined.

    Returns a JSONFormat for objects of a type using the current list of fields defined.

    A

    the type of objects for which a JSONFormat is to be returned

    readFunc

    a function converting the list of fields to an instance of A

    writeFunc

    a function extracting the list of fields from an instance of A

    returns

    a JSONFormat for objects of type A.

  18. def jsonReader[A](readFunc: ReadFunc[A]): RootJsonReader[A]

    Returns a JSONReader for objects of a type using the current list of fields defined.

    Returns a JSONReader for objects of a type using the current list of fields defined.

    A

    the type of objects for which a JSONFormat is to be returned

    readFunc

    a function converting the list of fields to an instance of A

    returns

    a JSONFormat for objects of type A.

  19. def jsonWriter[A](writeFunc: WriteFunc[A]): RootJsonWriter[A]

    Returns a JSONWriter for objects of a type using the current list of fields defined.

    Returns a JSONWriter for objects of a type using the current list of fields defined.

    A

    the type of objects for which a JSONFormat is to be returned

    writeFunc

    a function extracting the list of fields from an instance of A

    returns

    a JSONFormat for objects of type A.

  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. def optionalField[A](name: String, jf: JsonFormat[A])(implicit ev: AppenderAux[Option[A], C, FC], dummy: DummyImplicit): JsonFormatBuilder[COut, FCOut]

    Adds an optional field to this builder which defaults to None.

    Adds an optional field to this builder which defaults to None.

    A

    the type of the new field

    name

    the name of the new field

    jf

    a JSONFormat to use in the new field

    returns

    a new instance of JsonFormatBuilder with the new field

  24. def optionalField[A](name: String)(implicit jf: JsonFormat[A], ev: AppenderAux[Option[A], C, FC]): JsonFormatBuilder[COut, FCOut]

    Adds an optional field to this builder which defaults to None.

    Adds an optional field to this builder which defaults to None.

    A

    the type of the new field

    name

    the name of the new field

    returns

    a new instance of JsonFormatBuilder with the new field

  25. def removeField[N <: Nat](implicit ev: RemoverAux[C, FC, N]): JsonFormatBuilder[COut, FCOut]

    Removes a field in this builder.

    Removes a field in this builder.

    N

    the index of the field to remove

    returns

    a new instance of JsonFormatBuilder with the field removed

  26. def replaceField[N <: Nat, A](name: String, default: A, jf: JsonFormat[A])(implicit ev: ReplacerAux[A, C, FC, N], dummy: DummyImplicit): JsonFormatBuilder[COut, FCOut]

    Replaces a field in this builder with another one.

    Replaces a field in this builder with another one.

    N

    the index of the field to replace

    A

    the type of the new field

    name

    the name of the new field

    default

    the default value of the new field

    jf

    a JSONFormat to use in the new field

    returns

    a new instance of JsonFormatBuilder with the field replaced

  27. def replaceField[N <: Nat, A](name: String, default: A)(implicit jf: JsonFormat[A], ev: ReplacerAux[A, C, FC, N]): JsonFormatBuilder[COut, FCOut]

    Replaces a field in this builder with another one.

    Replaces a field in this builder with another one.

    N

    the index of the field to replace

    A

    the type of the new field

    name

    the name of the new field

    default

    the default value of the new field

    returns

    a new instance of JsonFormatBuilder with the field replaced

  28. def replaceField[N <: Nat, A](name: String)(implicit jf: JsonFormat[A], ev: ReplacerAux[A, C, FC, N]): JsonFormatBuilder[COut, FCOut]

    Replaces a field in this builder with another one.

    Replaces a field in this builder with another one.

    N

    the index of the field to replace

    A

    the type of the new field

    name

    the name of the new field

    returns

    a new instance of JsonFormatBuilder with the field replaced

  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped