Jackson patch object by map

Viewed 1283

I have a following test code:

Model model = new Model();
model.setName("Alex");
model.setAddress("NY");

Map<Object, Object> attrs = new HashMap<>();
attrs.put("address", "London");

I need to patch my existing model object with only values from attrs Map.

so, after the executing the code I need to have existing model object with a following values:

name: Alex
address: London

Is it possible to implement with Jackson library ? If so, please show an example.

1 Answers
Related