Hi there.
Trying to find out how to handle the next situation.
F.x.
public class ClassA {
String b;
boolean c;
Pair p;
// constructors, getters, setters
}
public class Pair {
String x;
String y;
// constructors, getters, setters
}
In JSON I want this stuff to look smth. like this:
{
"b" : "value b",
"c" : true,
"pair" : "x=>y"
}
Can't get it working just specifying a custom JsonDeserializer for Pair class.
Why haven't I written simply JsonDeserializer for ClassA is because I have similar classes (ClassB, ClassC) that contain Pair object as well.
I this case I need to write JsonDeserializer for each class containing Pair object.
Does anyone have an idea about solution?