@FunctionalInterface public interface MethodMatcher extends MethodMetadataLookup<Boolean>, Predicate<Method>
方法匹配器,本身可作为Predicate校验方法是否匹配指定条件。
当作为MethodMetadataLookup使用时,
若方法符合条件,则返回Boolean.TRUE,否则返回null。
MethodMatcherUtil,
MethodMetadataLookup| 限定符和类型 | 方法和说明 |
|---|---|
default MethodMatcher |
and(Predicate<? super Method> other)
返回一个组合的条件,当且仅当所有条件都符合时,才返回
true, |
default Boolean |
inspect(Method method)
检查方法,若结果不为
null则认为方法与其匹配 |
default MethodMatcher |
negate()
返回一个与此条件相反的条件
|
default MethodMatcher |
or(Predicate<? super Method> other)
返回一个组合的条件,当且仅当任一条件符合时,才返回
true, |
default MethodMatcher and(Predicate<? super Method> other)
true,and 在接口中 Predicate<Method>other - 其他条件NullPointerException - 当other为null时抛出default MethodMatcher negate()
default MethodMatcher or(Predicate<? super Method> other)
true,or 在接口中 Predicate<Method>other - 其他条件NullPointerException - 当other为null时抛出default Boolean inspect(Method method)
null则认为方法与其匹配inspect 在接口中 MethodMetadataLookup<Boolean>method - 要检查的方法Copyright © 2024. All rights reserved.