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 Type
    Method
    Description
    fromMethodMatcher(org.openrewrite.java.MethodMatcher methodMatcher)
     
    default boolean
    matches(@Nullable org.openrewrite.java.tree.Expression maybeMethod)
    Whether the method invocation or constructor matches the criteria of this matcher.
    default boolean
    matches(@Nullable org.openrewrite.java.tree.MethodCall methodCall)
     
    boolean
    matches(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:
      matches in interface InvocationMatcher
      Parameters:
      maybeMethod - Any Expression that might be a method invocation or constructor.
      Returns:
      True if the invocation or constructor matches the criteria of this matcher.
    • fromMethodMatcher

      static JavaTypeMethodMatcher fromMethodMatcher(org.openrewrite.java.MethodMatcher methodMatcher)