class
GsonTypeAdapter extends JsonSerializer[TypeWrapper[_]] with JsonDeserializer[TypeWrapper[_]]
Instance Constructors
-
new
GsonTypeAdapter(typeHints: TypeHints = EmptyTypeHints.apply())
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
deserialize(jsonElement: JsonElement, t: Type, jdc: JsonDeserializationContext): TypeWrapper[_]
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
serialize(obj: TypeWrapper[_], t: Type, jdc: JsonSerializationContext): JsonElement
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
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]])