mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add version
This commit is contained in:
parent
0a88978c58
commit
c8707966be
@ -65,11 +65,11 @@ public class LambdaFactory {
|
||||
* @return 接受Lambda的函数式接口对象
|
||||
* @param <F> Function类型
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <F> F build(final Class<F> functionInterfaceType, final Method method) {
|
||||
Assert.notNull(functionInterfaceType);
|
||||
Assert.notNull(method);
|
||||
final MutableEntry<Class<?>, Method> cacheKey = new MutableEntry<>(functionInterfaceType, method);
|
||||
//noinspection unchecked
|
||||
return (F) CACHE.computeIfAbsent(cacheKey, key -> {
|
||||
final List<Method> abstractMethods = Arrays.stream(functionInterfaceType.getMethods())
|
||||
.filter(m -> Modifier.isAbstract(m.getModifiers()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user