List<Map<String, Object>> map = new ArrayList<Map<String,Object>>();
Map<String, Object> mapList = new HashMap<>();
mapList.put("xxx", 1);
Map<String, Object> mapList2 = new HashMap<>();
mapList2.put("xxx", 2);
Map<String, Object> mapList3 = new HashMap<>();
mapList3.put("xxx", 3);
map.add(mapList2);
map.add(mapList3);
map.add(mapList3);
转为Map<String,List<String>> 键是xxx,值是1,2,3
已采纳
java List<Map<String, Object>> 转成Map<String,List<String>>
- 写回答
- 好问题 提建议
- 追加酬金
- 关注问题
- 分享
- 邀请回答