Andrew
05/30/2020, 8:57 PMEvent<P>
, and a bunch of objects that inherit from the class with a few different types for P
. I receive some json that has a name field so that I can match it to one of the objects, and data field that I want to deserialize into an object of type P
. Is there any way to do this without doing a case-by-case when for each event type?Jakub Pi
05/30/2020, 9:01 PMAndrew
05/30/2020, 9:02 PMDominaezzz
05/30/2020, 9:04 PMDominaezzz
05/30/2020, 9:05 PMkotlinx.serialization
also supports polymorphism. (Although combining it with generics is a bit.... complicated)Jakub Pi
05/30/2020, 9:05 PM@JsonTypeInfo
inside Jackson. There are a few ways to wire it in, but I've never used it with Generics.Jakub Pi
05/30/2020, 9:08 PMAdam Powell
05/30/2020, 9:10 PMnkiesel
06/01/2020, 7:25 PMjw
06/01/2020, 8:41 PMnkiesel
06/03/2020, 5:41 AMjw
06/03/2020, 12:57 PMnkiesel
06/04/2020, 10:50 AM