Config

upickle.core.Config
trait Config

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def allowUnknownKeys: Boolean

Configure whether you want upickle to skip unknown keys during de-serialization of case classes. Can be overriden for the entire serializer via override def, and further overriden for individual case classes via the annotation @upickle.implicits.allowUnknownKeys(b: Boolean)

Configure whether you want upickle to skip unknown keys during de-serialization of case classes. Can be overriden for the entire serializer via override def, and further overriden for individual case classes via the annotation @upickle.implicits.allowUnknownKeys(b: Boolean)

Attributes

def objectAttributeKeyReadMap(s: CharSequence): CharSequence

Transform dictionary keys when writing case classes when reading. Can be overriden to provide custom mappings between Scala field names and JSON field names. Needs to be kept in sync with objectAttributeKeyWriteMap

Transform dictionary keys when writing case classes when reading. Can be overriden to provide custom mappings between Scala field names and JSON field names. Needs to be kept in sync with objectAttributeKeyWriteMap

This customizes the mapping across all case classes fields handled by this upickle instance. This can be customized on a field-by-field basis using the upickle.implicits.key annotation on the case class field

Attributes

def objectAttributeKeyWriteMap(s: CharSequence): CharSequence

Map the name of JSON object fields to Scala case class fields during serialization. Must be kept in sync with objectAttributeKeyReadMap

Map the name of JSON object fields to Scala case class fields during serialization. Must be kept in sync with objectAttributeKeyReadMap

Attributes

def objectTypeKeyReadMap(s: CharSequence): CharSequence

Transforms the value of the $type field when writing sealed traits, to allow custom mapping between the case class name and the $type field in the generated JSON. Must be kept in sync with objectTypeKeyWriteMap.

Transforms the value of the $type field when writing sealed traits, to allow custom mapping between the case class name and the $type field in the generated JSON. Must be kept in sync with objectTypeKeyWriteMap.

  • This customizes the mapping across all case classes fields handled by this
  • upickle instance. This can be customized on a per-sealed trait basis using the
  • upickle.implicits.key annotation on the case class

Attributes

Whether to use the fully-qualified name of case classes and case objects which are part of sealed trait hierarchies when serializing them and writing their $type key. Defaults to false, so $type key uses the shortest partially-qualified name. Can be set to true to use their fully-qualified name.

Whether to use the fully-qualified name of case classes and case objects which are part of sealed trait hierarchies when serializing them and writing their $type key. Defaults to false, so $type key uses the shortest partially-qualified name. Can be set to true to use their fully-qualified name.

Attributes

def objectTypeKeyWriteMap(s: CharSequence): CharSequence

Map the name of Scala case class type names to JSON $type field value during serialization. Must be kept in sync with objectTypeKeyReadMap

Map the name of Scala case class type names to JSON $type field value during serialization. Must be kept in sync with objectTypeKeyReadMap

Attributes

def optionsAsNulls: Boolean

Whether top-level Some(t)s and Nones are serialized unboxed as t or null, rather than [t] or []. This is generally what people expect, although it does cause issues where Some(null) when serialized and de-serialized can become None. Can be disabled to use the boxed serialization format as 0-or-1-element-arrays, presering round trip-ability at the expense of un-intuitiveness and verbosity

Whether top-level Some(t)s and Nones are serialized unboxed as t or null, rather than [t] or []. This is generally what people expect, although it does cause issues where Some(null) when serialized and de-serialized can become None. Can be disabled to use the boxed serialization format as 0-or-1-element-arrays, presering round trip-ability at the expense of un-intuitiveness and verbosity

Attributes

def serializeDefaults: Boolean

Whether or not to write case class keys which match their default values. Defaults to false, allowing those keys to be omitted. Can be set to true to always write field values even if they are equal to the default

Whether or not to write case class keys which match their default values. Defaults to false, allowing those keys to be omitted. Can be set to true to always write field values even if they are equal to the default

Attributes

def tagName: String

Specifies the name of the field used to distinguish different case classes under a sealed trait. Defaults to $type, but can be configured globally by overriding tagName, or on a per-sealed trait basis via the @key annotation

Specifies the name of the field used to distinguish different case classes under a sealed trait. Defaults to $type, but can be configured globally by overriding tagName, or on a per-sealed trait basis via the @key annotation

Attributes