currently I'm doing this to convert JsonNode
to a POJO:
try {
MyClass obj = mapper.treeToValue(jsonData, MyClass.class)));
/* consume obj */
} catch (JsonProcessingException ex) {
return false;
}
But sometimes I don't want to get a new instance of MyClass
. I have have populated it before and now I just want to set new values for some fields and keep old values for unchanged fields. What I want is something like this: mapper.readJsonNodeToPOJO(jsonData, obj)));
Is it possible to do this?