Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 794 Bytes

File metadata and controls

24 lines (19 loc) · 794 Bytes

Gson-Polymorphism-Example

Java8 build

  • A simple Gson polymorphism serialization and deserialization example by using TypeAdapterFactory.
  • Modified from stack overflow

How to use

$ git clone https://github.com/dyhe83/Gson-Polymorphism-Example.git --depth=1
$ cd Gson-Polymorphism-Example
$ ./gradlew run

[Animal]
Numbers of foot = 0

[Bird]
Numbers of foot = 2
Numbers of eye  = 2

[Cat]
Numbers of foot = 4
Numbers of tail = 1