Class

com.github.plokhotnyuk.jsoniter_scala.macros

CodecMakerConfig

Related Doc: package macros

Permalink

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

Configuration parameter for JsonCodecMaker.make() call.

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

Examples of 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 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 turn on stringification of number or boolean values of collections, options and value classes (turned off by default)

skipUnexpectedFields

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

transientDefault

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

bitSetValueLimit

an exclusive limit for accepted numeric values in bit sets (1024 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)

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: (String) ⇒ String = identity, adtLeafClassNameMapper: (String) ⇒ String = JsonCodecMaker.simpleClassName, discriminatorFieldName: Option[String] = Some("type"), isStringified: Boolean = false, skipUnexpectedFields: Boolean = true, transientDefault: Boolean = true, bitSetValueLimit: Int = 1024, bigDecimalPrecision: Int = 34, bigDecimalScaleLimit: Int = 6178, bigDecimalDigitsLimit: Int = 308, bigIntDigitsLimit: Int = 308)

    Permalink

    fieldNameMapper

    the 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 turn on stringification of number or boolean values of collections, options and value classes (turned off by default)

    skipUnexpectedFields

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

    transientDefault

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

    bitSetValueLimit

    an exclusive limit for accepted numeric values in bit sets (1024 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)

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. val adtLeafClassNameMapper: (String) ⇒ String

    Permalink

    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)

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val bigDecimalDigitsLimit: Int

    Permalink

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

  7. val bigDecimalPrecision: Int

    Permalink

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

  8. val bigDecimalScaleLimit: Int

    Permalink

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

  9. val bigIntDigitsLimit: Int

    Permalink

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

  10. val bitSetValueLimit: Int

    Permalink

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

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. val discriminatorFieldName: Option[String]

    Permalink

    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)

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. val fieldNameMapper: (String) ⇒ String

    Permalink

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

  15. def finalize(): Unit

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

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

    Permalink
    Definition Classes
    Any
  18. val isStringified: Boolean

    Permalink

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  22. val skipUnexpectedFields: Boolean

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  24. val transientDefault: Boolean

    Permalink

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

  25. final def wait(): Unit

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

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