Default

Default and recommended ADT encoding strategy. Encodes the ADT super type as a single-element map with the only member consisting of the type ID as key and the instance encoding as the value.

Example:

A Dog instance from this ADT:

 sealed trait Animal
 case class Dog(age: Int, name: String)                      extends Animal
 case class Cat(weight: Double, color: String, home: String) extends Animal
 case class Mouse(tail: Boolean)                             extends Animal

would be encoded as such, for example:

 {
   "Dog" :  {
     "age": 2,
     "name": "Lolle"
    }
 }
class Object
trait Matchable
class Any
Default.type

Value members

Concrete methods

def readAdtEnvelopeClose(r: Reader, openResult: Boolean, typeName: String): Unit
def readAdtEnvelopeOpen(r: Reader, typeName: String): Boolean
def writeAdtEnvelopeClose(w: Writer, typeName: String): w.type
def writeAdtEnvelopeOpen(w: Writer, typeName: String): w.type