I'm trying to compare Name and get same value from JSON in Map<String,Object>.
"data":{
"list":[
{
"Status":"ACTIVE",
"Name":"AA",
},
{
"Status":"CLOSE",
"Name":"BB",
},
{
"Status":"CLOSE",
"Name":"CC",
},
]
}
for(Object obj : (List<Object>) mapCustList.get('list')){
Map<String, Object> keyMap = (Map<String, Object>)obj;
if(keyMap.values() == 'AA'){
mapList.add(keyMap);
}
}
the expected result should be {"Status":"ACTIVE","Name":"AA"}