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