java用stream流遍历List
场景一:
获取List里的map中的某个字段,抽取为List<String>
List<String> xAxis = dataList.stream()
.map(e -> e.get("time").toString()).collect(Collectors.toList());
// 如果字段需要过滤
List<String> zt = dataList.stream()
.filter(m -> StringUtils.isNotEmpty(m.get("time").toString()))
.map(e -> e.get("time").toString())
.collect(Collectors.toList());