I want to iterate over a MultiValueMap
of type <String,Any>
where Any can be another MultiValueMap
of type <String,Any>
and the Any can be another MultiValeMap and so on. The code I have is to extract only the first level of the Map:- ("result" variable is the MultiValueMap
)
val entrySet = result.entrySet();
val it = entrySet.iterator();
//System.out.println(" Object key Object value");
while (it.hasNext()) {
val mapEntry= it.next().asInstanceOf[java.util.Map.Entry[String,Any]];
val list = (result.get(mapEntry.getKey()).asInstanceOf[List[String]])
for (j <- 0 to list.size - 1) {
//mapEntry.setValue("dhjgdj")
System.out.println("\t" + mapEntry.getKey() + "\t " + list.get(j));
}
}