Interface MethodMatcher

All Known Subinterfaces:
TargetedMethodMatcher
All Known Implementing Classes:
TargetedMethodMatcherImpl
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MethodMatcher
  • Method Details

    • builder

      static MethodMatcherBuilder builder()
    • single

      static MethodMatcher single(String name, Consumer<MethodMatcherBuilder.MatchBuilder> matchBuilderConsumer)
    • matches

      boolean matches(int opcode, boolean isInvokeDynamic, String name, String descriptor)
    • matches

      default boolean matches(int opcode, boolean isInvokeDynamic, String name, MethodTypeDesc descriptor)
    • or

      default MethodMatcher or(MethodMatcher other)
      Creates a method matcher that matches if either matcher passes.
      Parameters:
      other - the other matcher
      Returns:
      a new "or" matcher
    • and

      default MethodMatcher and(MethodMatcher other)
      Creates a method matcher that matches if both matcher pass.
      Parameters:
      other - the other matcher
      Returns:
      a new "and" matcher
      See Also:
    • and

      default MethodMatcher and(Predicate<? super MethodTypeDesc> descPredicate)
      Creates a method matcher tha matches if both this matcher and the method descriptor predicate pass.
      Parameters:
      descPredicate - the method descriptor predicate
      Returns:
      a new "and" matcher
    • negate

      default MethodMatcher negate()
      Creates a method matcher that is the inverse of this matcher.
      Returns:
      the inverse matcher