Comparator集合排序

 sort by usetheresholdfullpay , amount desc;

Comparator<CouponVO> compareAmonunt = Comparator.comparing(CouponVO :: getAmount);
Comparator<CouponVO> compareFullPay = Comparator.comparing(CouponVO :: getUsethresholdfullpay);
Collections.sort(list2,compareFullPay.thenComparing(compareAmonunt.reversed()));

猜你喜欢

转载自blog.csdn.net/qq_31024823/article/details/89847369