classGsonTypeAdapter extends JsonSerializer[TypeWrapper[_]] with JsonDeserializer[TypeWrapper[_]]
Gson adapter to be used to serialize and serialize TypeWrapper to and from JSON
with Gson.
To be used when the developer wishes to to include a interface type in the model object,
or one of its fields.
e.g. to store a List[Bird], or just val b: Bird, where
trait Bird
class Robin() extends Bird
class Eagle() extends Bird
the Bird type should be wrapped in TypeWrapper:
case class Aviary(specialBird: TypeWrapper[Bird], commonBirds: List[TypeWrapper[Bird]])
Gson adapter to be used to serialize and serialize TypeWrapper to and from JSON with Gson.
To be used when the developer wishes to to include a interface type in the model object, or one of its fields.
e.g. to store a List[Bird], or just val b: Bird, where trait Bird class Robin() extends Bird class Eagle() extends Bird the Bird type should be wrapped in TypeWrapper: case class Aviary(specialBird: TypeWrapper[Bird], commonBirds: List[TypeWrapper[Bird]])