I have a json file with same key but different values as follows,
{
"domains" : {
"A" : {
"name" : "a",
"type" : "a1"
},
"B" :{
"name" : "r",
"type" : "g1"
},
"A" : {
"name" : "b",
"type" : "b1"
}
}
}
which is coming from external system. How to convert the json to java map object and access the different values of the key: A
I am using something like below,
map = mapper.readValue(json, new TypeReference<HashMap<String,String>>(){});
which returns a map with unique keys. But I need a map object to hold all the data from json file.
Anyway to achieve this?