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. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. 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

  9. 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

  10. 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

  11. val fields: FC

    Permalink

    the fields currently in this builder

  12. def finalize(): Unit

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

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

    Permalink
    Definition Classes
    Any
  15. 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.

  16. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  19. 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

  20. 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

  21. 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

  22. 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

  23. 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

  24. 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

  25. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. 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