Class Matchers

org.elasticsearch.common.inject.matcher.Matchers

public class Matchers extends
Matcher implementations. Supports matching classes and methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    static >
     annotation)
    Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.
    static >
    <? extends > annotationType)
    Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.
    static >
    any()
    Returns a matcher which matches any input.
    static >
     value)
    Returns a matcher which matches only the given object.
    static >
     targetPackage)
    Returns a matcher which matches classes in the given package.
    static >
     targetPackageName)
    Returns a matcher which matches classes in the given package and its subpackages.
    static <T> Matcher<T>
    not​(Matcher<? super T> p)
    Inverts the given matcher.
    static >
     value)
    Returns a matcher which matches objects equal to the given object.
    static >
    <?>> returnType)
    Returns a matcher which matches methods with matching return types.
    static >
    <?> superclass)
    Returns a matcher which matches subclasses of the given type (as well as the given type).

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Method Details

    • any

      public static > any()
      Returns a matcher which matches any input.
    • not

      public static <T> Matcher<T> not(Matcher<? super T> p)
      Inverts the given matcher.
    • annotatedWith

      public static > annotatedWith(<? extends > annotationType)
      Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.
    • annotatedWith

      public static > annotatedWith( annotation)
      Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.
    • subclassesOf

      public static > subclassesOf(<?> superclass)
      Returns a matcher which matches subclasses of the given type (as well as the given type).
    • only

      public static > only( value)
      Returns a matcher which matches objects equal to the given object.
    • identicalTo

      public static > identicalTo( value)
      Returns a matcher which matches only the given object.
    • inPackage

      public static > inPackage( targetPackage)
      Returns a matcher which matches classes in the given package. Packages are specific to their classloader, so classes with the same package name may not have the same package at runtime.
    • inSubpackage

      public static > inSubpackage( targetPackageName)
      Returns a matcher which matches classes in the given package and its subpackages. Unlike inPackage(), this matches classes from any classloader.
      Since:
      2.0
    • returns

      public static > returns(<?>> returnType)
      Returns a matcher which matches methods with matching return types.