map中的循环遍历
Map<String, CmmodityItem> cmmodityItemss =
cmmodityItem.stream().collect(Collectors.toMap(CmmodityItem::getDataId, temp -> temp, (e1, e2) -> e2));
List<CmmodityItem> cmmodityItemList = new ArrayList<>();
for (Map.Entry<String, CmmodityItem> entry : cmmodityItemss.entrySet()) {
CmmodityItem value = entry.getValue();
cmmodityItemList.add(value);
}
}
本文来自博客园,作者:diligently,转载请注明原文链接:https://www.cnblogs.com/luo12828-foxmail/p/16964078.html

浙公网安备 33010602011771号