Packages

case class CodecMakerConfig(fieldNameMapper: PartialFunction[String, String] = JsonCodecMaker.partialIdentity, adtLeafClassNameMapper: (String) ⇒ String = JsonCodecMaker.simpleClassName, discriminatorFieldName: Option[String] = Some("type"), isStringified: Boolean = false, mapAsArray: Boolean = false, skipUnexpectedFields: Boolean = true, transientDefault: Boolean = true, transientEmpty: Boolean = true, transientNone: Boolean = true, bigDecimalPrecision: Int = 34, bigDecimalScaleLimit: Int = 6178, bigDecimalDigitsLimit: Int = 308, bigIntDigitsLimit: Int = 308, bitSetValueLimit: Int = 1024, mapMaxInsertNumber: Int = 1024, setMaxInsertNumber: Int = 1024, allowRecursiveTypes: Boolean = false) extends Product with Serializable

Configuration parameter for JsonCodecMaker.make() call.

BEWARE: a parameter of the make macro should not depend on code from the same compilation module where it is called. Use a separated submodule of the project to compile all such dependencies before their usage for generation of codecs.

Examples of fieldNameMapper and adtLeafClassNameMapper functions that have no dependencies in the same compilation module are: JsonCodecMaker.enforceCamelCase, JsonCodecMaker.enforce_snake_case, JsonCodecMaker.enforce-kebab-case, and JsonCodecMaker.simpleClassName. Or their composition like: s => JsonCodecMaker.enforce_snake_case(JsonCodecMaker.simpleClassName(s))

fieldNameMapper

the partial function of mapping from string of case class field name to JSON key (an identity function by default)

adtLeafClassNameMapper

the function of mapping from string of case class/object full name to string value of discriminator field (a function that truncate to simple class name by default)

discriminatorFieldName

an optional name of discriminator field, where None can be used for alternative representation of ADTs without the discriminator field (Some("type") value by default)

isStringified

a flag that turns on stringification of number or boolean values of collections, options and value classes (turned off by default)

mapAsArray

a flag that turns on serialization and parsing of maps as a JSON array (or sequences of tuples) instead of a JSON object, that allow to use 'JsonValueCodec' for encoding and decoding of keys (turned off by default)

skipUnexpectedFields

a flag that turns on skipping of unexpected fields or in other case a parse exception will be thrown (turned on by default)

transientDefault

a flag that turns on skipping serialization of fields that have same values as default values defined for them in the primary constructor (turned on by default)

transientEmpty

a flag that turns on skipping serialization of fields that have empty values of arrays or collections (turned on by default)

transientNone

a flag that turns on skipping serialization of fields that have empty values of options (turned on by default)

bigDecimalPrecision

a precision in 'BigDecimal' values (34 by default)

bigDecimalScaleLimit

an exclusive limit for accepted scale in 'BigDecimal' values (6178 by default)

bigDecimalDigitsLimit

an exclusive limit for accepted number of decimal digits in 'BigDecimal' values (308 by default)

bigIntDigitsLimit

an exclusive limit for accepted number of decimal digits in 'BigInt' values (308 by default)

bitSetValueLimit

an exclusive limit for accepted numeric values in bit sets (1024 by default)

mapMaxInsertNumber

a max number of inserts into maps (1024 by default)

setMaxInsertNumber

a max number of inserts into sets excluding bit sets (1024 by default)

allowRecursiveTypes

a flag that turns on support of recursive types (turned off by default)

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CodecMakerConfig
  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 CodecMakerConfig(fieldNameMapper: PartialFunction[String, String] = JsonCodecMaker.partialIdentity, adtLeafClassNameMapper: (String) ⇒ String = JsonCodecMaker.simpleClassName, discriminatorFieldName: Option[String] = Some("type"), isStringified: Boolean = false, mapAsArray: Boolean = false, skipUnexpectedFields: Boolean = true, transientDefault: Boolean = true, transientEmpty: Boolean = true, transientNone: Boolean = true, bigDecimalPrecision: Int = 34, bigDecimalScaleLimit: Int = 6178, bigDecimalDigitsLimit: Int = 308, bigIntDigitsLimit: Int = 308, bitSetValueLimit: Int = 1024, mapMaxInsertNumber: Int = 1024, setMaxInsertNumber: Int = 1024, allowRecursiveTypes: Boolean = false)

    fieldNameMapper

    the partial function of mapping from string of case class field name to JSON key (an identity function by default)

    adtLeafClassNameMapper

    the function of mapping from string of case class/object full name to string value of discriminator field (a function that truncate to simple class name by default)

    discriminatorFieldName

    an optional name of discriminator field, where None can be used for alternative representation of ADTs without the discriminator field (Some("type") value by default)

    isStringified

    a flag that turns on stringification of number or boolean values of collections, options and value classes (turned off by default)

    mapAsArray

    a flag that turns on serialization and parsing of maps as a JSON array (or sequences of tuples) instead of a JSON object, that allow to use 'JsonValueCodec' for encoding and decoding of keys (turned off by default)

    skipUnexpectedFields

    a flag that turns on skipping of unexpected fields or in other case a parse exception will be thrown (turned on by default)

    transientDefault

    a flag that turns on skipping serialization of fields that have same values as default values defined for them in the primary constructor (turned on by default)

    transientEmpty

    a flag that turns on skipping serialization of fields that have empty values of arrays or collections (turned on by default)

    transientNone

    a flag that turns on skipping serialization of fields that have empty values of options (turned on by default)

    bigDecimalPrecision

    a precision in 'BigDecimal' values (34 by default)

    bigDecimalScaleLimit

    an exclusive limit for accepted scale in 'BigDecimal' values (6178 by default)

    bigDecimalDigitsLimit

    an exclusive limit for accepted number of decimal digits in 'BigDecimal' values (308 by default)

    bigIntDigitsLimit

    an exclusive limit for accepted number of decimal digits in 'BigInt' values (308 by default)

    bitSetValueLimit

    an exclusive limit for accepted numeric values in bit sets (1024 by default)

    mapMaxInsertNumber

    a max number of inserts into maps (1024 by default)

    setMaxInsertNumber

    a max number of inserts into sets excluding bit sets (1024 by default)

    allowRecursiveTypes

    a flag that turns on support of recursive types (turned off by default)

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. val adtLeafClassNameMapper: (String) ⇒ String
  5. val allowRecursiveTypes: Boolean
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val bigDecimalDigitsLimit: Int
  8. val bigDecimalPrecision: Int
  9. val bigDecimalScaleLimit: Int
  10. val bigIntDigitsLimit: Int
  11. val bitSetValueLimit: Int
  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  13. val discriminatorFieldName: Option[String]
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. val fieldNameMapper: PartialFunction[String, String]
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. val isStringified: Boolean
  20. val mapAsArray: Boolean
  21. val mapMaxInsertNumber: Int
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. val setMaxInsertNumber: Int
  26. val skipUnexpectedFields: Boolean
  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. val transientDefault: Boolean
  29. val transientEmpty: Boolean
  30. val transientNone: Boolean
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped