Class ModifierMatcher<T extends ModifierReviewable>

Type Parameters:
T - The type of the matched entity.
All Implemented Interfaces:
ElementMatcher<T>, ElementMatcher.Junction<T>

@Enhance public class ModifierMatcher<T extends ModifierReviewable> extends ElementMatcher.Junction.ForNonNullValues<T>
An element matcher that matches a byte code element by its modifiers.
  • Field Details

    • mode

      private final ModifierMatcher.Mode mode
      The matching mode to apply by this modifier matcher.
  • Constructor Details

    • ModifierMatcher

      public ModifierMatcher(ModifierMatcher.Mode mode)
      Creates a new element matcher that matches an element by its modifier.
      Parameters:
      mode - The match mode to apply to the matched element's modifier.
  • Method Details

    • of

      public static <T extends ModifierReviewable> ElementMatcher.Junction<T> of(ModifierMatcher.Mode mode)
      Returns a new element matcher that matches an element by its modifier.
      Type Parameters:
      T - The type of the matched entity.
      Parameters:
      mode - The match mode to apply to the matched element's modifier.
      Returns:
      A matcher that matches methods of the provided sort.
    • doMatch

      protected boolean doMatch(T target)
      Matches the supplied value if it was found not to be null.
      Specified by:
      doMatch in class ElementMatcher.Junction.ForNonNullValues<T extends ModifierReviewable>
      Parameters:
      target - The instance to be matched.
      Returns:
      true if the given element is matched by this matcher or false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object