Class ClassLoaderParentMatcher<T extends ClassLoader>

java.lang.Object
net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<T>
net.bytebuddy.matcher.ClassLoaderParentMatcher<T>
Type Parameters:
T - The exact type of the class loader that is matched.
All Implemented Interfaces:
ElementMatcher<T>, ElementMatcher.Junction<T>

@Enhance public class ClassLoaderParentMatcher<T extends ClassLoader> extends ElementMatcher.Junction.AbstractBase<T>
An element matcher that matches a class loader for being a parent of the given class loader.
  • Field Details

  • Constructor Details

    • ClassLoaderParentMatcher

      public ClassLoaderParentMatcher(@MaybeNull ClassLoader classLoader)
      Creates a class loader parent element matcher.
      Parameters:
      classLoader - The class loader that is matched for being a child of the matched class loader.
  • Method Details

    • matches

      public boolean matches(@MaybeNull T target)
      Matches a target against this element matcher.
      Parameters:
      target - The instance to be matched or null.
      Returns:
      true if the given element is matched by this matcher or false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object