public static List<Purchase> removeDongxiangPurch(List<Purchase> listDongxiangPurchases){
ArrayList<Purchase> listDongxiangPurchase = listDongxiangPurchases.stream().collect(
Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(purchase -> purchase.getShopId() + purchase.getProductId()+ purchase.getFetchTime()))),
ArrayList::new
)
);
return listDongxiangPurchase;
}
去重。jdk1.8
最新推荐文章于 2024-07-20 12:43:53 发布
5477

被折叠的 条评论
为什么被折叠?



