【发布时间】:2013-12-18 09:28:23
【问题描述】:
你好,我有复杂的结构
Map<Map<String,String>, Map<String,String>> a
我想遍历它的所有元素。我试过了:
for(Map.Entry<Map<String,String>, Map<String,String>> first:firstMap.keySet()) {
...
}
错误是
Cannot cast object '{key1=value1, key2=value2, key3=value3, key4=value4}' with class 'java.util.LinkedHashMap' to class 'java.util.Map$Entry' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.Map$Entry(java.util.LinkedHashMap)
如何迭代我的地图?
【问题讨论】: