I have a class with the following structure
Class A {
private String type;
private T entity;
}
And my JSON structure is like this
{"type":"Relation1","entity":"{..}"} --> entity should be Relation1.class
{"type":"Relation2","entity":"{..}"} --> entity should be Relation2.class
How can I achieve the desired outcome using Jackson deserilizaton?