Package org.openrewrite.analysis
Interface JavaTypeMethodMatcher
- All Superinterfaces:
InvocationMatcher
- All Known Subinterfaces:
BasicJavaTypeMethodMatcher,GenericExternalModel
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@Incubating(since="8.1.3")
@FunctionalInterface
public interface JavaTypeMethodMatcher
extends InvocationMatcher
The most basic version of a
MethodMatcher that allows implementers to craft custom matching logic.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openrewrite.analysis.InvocationMatcher
InvocationMatcher.AdvancedInvocationMatcher -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaTypeMethodMatcherfromMethodMatcher(org.openrewrite.java.MethodMatcher methodMatcher) default booleanmatches(@Nullable org.openrewrite.java.tree.Expression maybeMethod) Whether the method invocation or constructor matches the criteria of this matcher.default booleanmatches(@Nullable org.openrewrite.java.tree.MethodCall methodCall) booleanmatches(org.openrewrite.java.tree.JavaType.Method type) Whether the method invocation or constructor matches the criteria of this matcher.Methods inherited from interface org.openrewrite.analysis.InvocationMatcher
advanced
-
Method Details
-
matches
boolean matches(@Nullable org.openrewrite.java.tree.JavaType.Method type) Whether the method invocation or constructor matches the criteria of this matcher.- Parameters:
type- The type of the method invocation or constructor.- Returns:
- True if the invocation or constructor matches the criteria of this matcher.
-
matches
default boolean matches(@Nullable @Nullable org.openrewrite.java.tree.MethodCall methodCall) -
matches
default boolean matches(@Nullable @Nullable org.openrewrite.java.tree.Expression maybeMethod) Whether the method invocation or constructor matches the criteria of this matcher.- Specified by:
matchesin interfaceInvocationMatcher- Parameters:
maybeMethod- AnyExpressionthat might be a method invocation or constructor.- Returns:
- True if the invocation or constructor matches the criteria of this matcher.
-
fromMethodMatcher
-