List<Map<String,String>> test = new ArrayList<>();
Map<String,String> map = new HashMap<>();
map.put("1a","1");
map.put("2a","2");
map.put("3a","3");
map.put("4a","4");
test.add(map);
List<String> stringList =
test.stream().flatMap(e->e.keySet().stream()).collect(Collectors.toList());
System.out.println(stringList);
java8 lambda List<Map<String,String>>转List<String>
最新推荐文章于 2024-07-11 22:25:06 发布