增加 get-routers 接口的相关方法,未完全完成

This commit is contained in:
YunaiV
2021-01-04 00:47:28 +08:00
parent 162bebf5fb
commit cf93019ce1
11 changed files with 181 additions and 22 deletions

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import java.util.*;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
@@ -17,6 +18,10 @@ public class CollectionUtils {
return new HashSet<>(Arrays.asList(objs));
}
public static <T> List<T> filterList(Collection<T> from, Predicate<T> predicate) {
return from.stream().filter(predicate).collect(Collectors.toList());
}
public static <T, U> List<U> convertList(List<T> from, Function<T, U> func) {
return from.stream().map(func).collect(Collectors.toList());
}