0

I read json

{
  "id"   : 1,
  "name" : {
    "first" : "Yong",
    "last" : "Mook Kim"
  },
  "contact" : [
    { "type" : "phone/home", "ref" : "111-111-1234"},
    { "type" : "phone/work", "ref" : "222-222-2222"}
  ]
}

by ObjectMapper

Map<String, Object> jsonMap = mapper.readValue(JsonNodeTest.class.getClassLoader().getResource("test.json"), Map.class);

value type may be

Map<String,Object>

also having

Map<String, Object> replaceValues = new HashMap<>();
replaceValues.put("id", "2")
replaceValues.put("first", "Yong");

how to change recursively change values in jsonMap?

Doctor
  • 33
  • 1
  • 4

0 Answers0