一 lamdba 表达式根据List集合 作为过滤条件 实战
1.1 判断一个集合的对象的id,是否存在于另一个集合id当中,如何存在,生成一个新的集合对象。
public List getFilterList(List<ReportFileBean> showlist,String rdpFileUuIds[]){
List rdpFileUuIdList = Arrays.asList(rdpFileUuIds);
List result = null;
result = showlist.stream()
.filter((ReportFileBean s) -> rdpFileUuIdList.contains(s.getUuid()))
.collect(Collectors.toList());
return result;
}
1.2 lambda 表达式如何遍历List<Map>
public static void main(String[] args) {
Map map1 = new HashMap();
map1.put("1",2); map1.put("2",3); map1.put("3",4);
Map map2 = new HashMap();
map2.put("3", 4); map2.put("5", 6); map2.put("7", 8); map2.put("9", 10);
List<