Class DeclaringTypeMatcher<T extends DeclaredByType>

java.lang.Object
net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<T>
net.bytebuddy.matcher.DeclaringTypeMatcher<T>
Type Parameters:
T - The exact type of the element being matched.
All Implemented Interfaces:
ElementMatcher<T>, ElementMatcher.Junction<T>

@Enhance public class DeclaringTypeMatcher<T extends DeclaredByType> extends ElementMatcher.Junction.AbstractBase<T>
An element matcher that matches the declaring type of another element, only if this element is actually declared in a type.
  • Field Details

  • Constructor Details

    • DeclaringTypeMatcher

      public DeclaringTypeMatcher(ElementMatcher<? super TypeDescription.Generic> matcher)
      Creates a new matcher for the declaring type of an element.
      Parameters:
      matcher - The type matcher to be applied if the target element is declared in a type.
  • Method Details

    • matches

      public boolean matches(T target)
      Matches a target against this element matcher.
      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