com.avsystem.commons.serialization
consumer of serialized value, which is guaranteed to meet the above rules
This ugly workaround has been introduced when standard Option
encoding changed from zero-or-one element list
encoding to unwrapped-or-null encoding which effectively disallowed serializing null
and Some(null)
.
This ugly workaround has been introduced when standard Option
encoding changed from zero-or-one element list
encoding to unwrapped-or-null encoding which effectively disallowed serializing null
and Some(null)
.
If some Output
implementation still wants to use the list encoding, it may do it by overriding this method
and returning true
.
An Output for GenCodec which serializes data into plain Scala objects.
- "lists" are represented as Scala
List
s - "objects" are represented asString
-keyed ScalaMap
s - simple values (strings, numbers, booleans, byte arrays) are represented as themselves, unchangedIn other words, serialized value yield by
SimpleValueOutput
is a Scala object guaranteed to be one of: -null
-Int
-Long
-Double
-BigInt
-BigDecimal
-Boolean
-String
-Array[Byte]
-scala.collection.Seq[Any]
where every element is also one of the listed types -scala.collection.Map[String,Any]
where every value is also one of the listed typesSuch format is often useful as an intermediate representation. For example, it can be later safely passed to standard Java serialization. However, for performance reasons it's recommended to implement dedicated Input and Output for the final format (e.g. binary or JSON).