the json string from server looks like below (Simplified)
{
"p1":"v1",
"c1":{
"a1":"string1",
"a2":"string2"
}
}
or
{
"p1":"v2",
"c2":{
"b1":"string3",
"b2":"string4"
}
}
is it a way to use jackson to deserialize the json string like that:
class P contains common response info(sign,status code,status msg......) class C1 and class C2 have their own specific business data
class P{
String p1;
}
class C1 extend P{
String a1;
String a2;
}
class C2 extend P{
String b1;
String b2;
}
Question(Simplified):
{"p1":"v1","c1":{"a1":"string1","a2":"string2"}}
to Class C1
,
{"p1":"v2","c2":{"b1":"string3","b2":"string4"}}
to Class C2