Class MethodSortMatcher<T extends MethodDescription>

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

@Enhance public class MethodSortMatcher<T extends MethodDescription> extends ElementMatcher.Junction.ForNonNullValues<T>
Matches a method description by its general characteristics which are represented as a MethodSortMatcher.Sort.
  • Field Details

    • sort

      private final MethodSortMatcher.Sort sort
      The sort of method description to be matched by this element matcher.
  • Constructor Details

    • MethodSortMatcher

      public MethodSortMatcher(MethodSortMatcher.Sort sort)
      Creates a new element matcher that matches a specific sort of method description.
      Parameters:
      sort - The sort of method description to be matched by this element matcher.
  • Method Details

    • of

      public static <T extends MethodDescription> ElementMatcher.Junction<T> of(MethodSortMatcher.Sort sort)
      Returns an element matcher that matches a specific sort of method description.
      Type Parameters:
      T - The type of the matched entity.
      Parameters:
      sort - The sort of method description to be matched by this element matcher.
      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 MethodDescription>
      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