cedric
12/12/2018, 5:51 PMfinal RuntimeTypeAdapterFactory<AbstractContainer> typeFactory = RuntimeTypeAdapterFactory
.of(Animal.class, "type") // Here you specify which is the parent class and what field particularizes the child class.
.registerSubtype(Dog.class, "dog") // if the flag equals the class name, you can skip the second parameter. This is only necessary, when the "type" field does not equal the class name.
.registerSubtype(Cat.class, "cat");