I am expecting to get from a json a LinkedList<Request>
.
The pojos look like this:
@Data
@Builder
public class Request {
private String id;
private List<Parameter> parameters;
}
@Data
@SuperBuilder
public abstract class Parameter implements Serializable {
private String key;
public abstract Object getValue();
}
@Data
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
public class StringParameter extends Parameter implements Serializable {
private String value;
}
@Data
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
public class PasswordParameter extends Parameter implements Serializable {
private String value;
}
The serialization works fine, it generates the json, but it crashes at deserialization (maybe it's the abstract class or/and that I am expecting a LinkedList
and/or the lombok annotations)?
I tryed writting a gson deserializer (quite a standard one found googling), but it doesn't do the job.