I am trying to find a way to convert JSON into Map where key is string and value will be List of objects.
Example JSON:
{
"name1": [
{
"host": "host1",
"isEnabled": true
},
{
"host": "host2",
"isEnabled": false
}
],
"name2": [
{
"host": "host1",
"isEnabled": true
},
{
"host": "host2",
"isEnabled": false
}
]
}
In above example "name1" will be the key and value will be list of object(that object will have "host" and "isEnabled" field).
I want to read this json convert in Map in java. Can someone help me in achieving this.