mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 19:15:06 +08:00
拼团活动:完善 review 提到的问题
This commit is contained in:
@ -25,15 +25,6 @@ public class CollectionUtils {
|
||||
return Arrays.stream(collections).anyMatch(CollectionUtil::isEmpty);
|
||||
}
|
||||
|
||||
// TODO @puhui999: list.sort(); 可以替代呀;
|
||||
public static <T, U extends Comparable<? super U>> List<T> sortedAsc(
|
||||
Collection<T> from, Function<? super T, ? extends U> keyExtractor) {
|
||||
// 按照升序排序
|
||||
return from.stream()
|
||||
.sorted(Comparator.comparing(keyExtractor))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static <T> boolean anyMatch(Collection<T> from, Predicate<T> predicate) {
|
||||
return from.stream().anyMatch(predicate);
|
||||
}
|
||||
|
Reference in New Issue
Block a user