I have json like below
{
"Prop1": "val1",
"Prop2": {
"changingpropert1": 100,
"changingpropert2": 200
},
}
{
"Prop1": "val1",
"Prop2": {
"changingpropert3": 100,
"changingpropert4": 200
},
}
I want to map this in pojo so my pojo will be like this.
public class One {
Prop2 prop2;
}
public class Prop2 {
private double changingpropert1;
private double changingpropert2;
}
Now I want flexiblity in Prop2 class to accept both two json in above example.
Do we have any solution?
Thanks in advance
How about using a Map
...
public class Prop2 {
private Map<String,Double> properties;
}