Class/Object

eu.shiftforward.apso.json

JsonFormatBuilder

Related Docs: object JsonFormatBuilder | package json

Permalink

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])

    Permalink

    fields

    the fields currently in this builder

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def customJsonFormat[A](preRead: (JsObject) ⇒ JsObject, readFunc: (C) ⇒ A, writeFunc: (A) ⇒ C, postWrite: (A, JsObject) ⇒ JsObject): RootJsonFormat[A]

    Permalink

    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

    returns

    a JSONFormat for objects of type A.

  7. def customJsonReader[A](preRead: (JsObject) ⇒ JsObject, readFunc: (C) ⇒ A): RootJsonReader[A]

    Permalink

    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

    returns

    a JSONReader for objects of type A.

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

    Permalink

    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

    Permalink
    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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

    Permalink

    the fields currently in this builder

  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def jsonFormat[A](readFunc: (C) ⇒ A, writeFunc: (A) ⇒ C): RootJsonFormat[A]

    Permalink

    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: (C) ⇒ A): RootJsonReader[A]

    Permalink

    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: (A) ⇒ C): RootJsonWriter[A]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. def optionalField[A](name: String, jf: JsonFormat[A])(implicit ev: AppenderAux[Option[A], C, FC], dummy: DummyImplicit): JsonFormatBuilder[COut, FCOut]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped