java8新特性之List处理
发布时间:2020-12-15 07:14:41 所属栏目:Java 来源:网络整理
导读:分组: MapString,ListT yearData = allData.stream().collect(Collectors.groupingBy(T::getYear)); 过滤筛选(单条件): ListT filterList = appleList.stream().filter(a - a.getName().equals( " YC " )).collect(Collectors.toList()); 过滤筛选(多条件):
分组: Map<String,List<T>> yearData = allData.stream().collect(Collectors.groupingBy(T::getYear)); 过滤筛选(单条件): List<T> filterList = appleList.stream().filter(a -> a.getName().equals("YC")).collect(Collectors.toList()); 过滤筛选(多条件): List<T> filterList = dayVoList. stream().filter(a -> a.getYEAR().equals(item)).collect(Collectors.toList()) .stream().filter(a -> a.getPrice() != 0" && a.getPrice() != 0.0").collect(Collectors.toList()); ? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |