【发布时间】:2016-09-28 15:23:48
【问题描述】:
我有以下方法:
protected Set<Map<String, Object>> joinQueryResults(Set<Map<String, Object>> resultEmpty, Set<Map<String, Object>> resultWithValues){
for(Map<String, Object> mapEmpty: resultEmpty){
for(Map<String, Object> mapValue: resultWithValues){
if (mapValue.get("name").equals(mapEmpty.get("name"))){
mapEmpty.replace("totfailed", mapValue.get("totfailed"));
mapEmpty.replace("totsuccess", mapValue.get("totsuccess"));
break;
}
}
}
return resultEmpty;
}
如何将其转换为 forEach 子句?有可能吗?
【问题讨论】: