Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val vehicleFactory = PolymorphicJsonAdapterFactory.of(Vehicle::class.java, "type")
.withSubtype(Truck::class.java, VehicleType.TRUCK.name)
.withSubtype(Plane::class.java, VehicleType.PLANE.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment