Default

io.bullet.borer.AdtEncodingStrategy$.Default$
object Default extends AdtEncodingStrategy

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"
    }
 }

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Default.type

Members list

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): Writer
def writeAdtEnvelopeOpen(w: Writer, typeName: String): Writer