拼团记录(APP):新增一个取消拼团的接口

This commit is contained in:
puhui999
2023-10-07 18:46:19 +08:00
parent 1a0fda23b1
commit 6636ee7420
9 changed files with 152 additions and 29 deletions

View File

@ -25,6 +25,14 @@ public class CollectionUtils {
return Arrays.stream(collections).anyMatch(CollectionUtil::isEmpty);
}
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);
}