得到的数据格式是0 id
name
1
2
想得到id的值怎么取出来
得到的数据格式是0 id
name
1
2
想得到id的值怎么取出来
LinkedHashMap<String, Object> map1 = new LinkedHashMap<>();
map1.put("id", 111);
map1.put("name", "aaa");
LinkedHashMap<String, Object> map2 = new LinkedHashMap<>();
map2.put("id", 333);
map2.put("name", "bbb");
List<LinkedHashMap<String, Object>> list = new ArrayList<>();
list.add(map1);
list.add(map2);
//取出id
List resultList = list.stream().map(item -> item.get("id")).collect(Collectors.toList());