public class Matchers extends Object
| Modifier and Type | Method and Description |
|---|---|
static Matcher |
annotatedWith(Annotation
Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.
|
static Matcher |
annotatedWith(Class
Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.
|
static Matcher |
any()
Returns a matcher which matches any input.
|
static Matcher |
identicalTo(Object
Returns a matcher which matches only the given object.
|
static Matcher |
inPackage(Package
Returns a matcher which matches classes in the given package.
|
static Matcher |
inSubpackage(String
Returns a matcher which matches classes in the given package and its subpackages.
|
static <T> Matcher |
not(Matcher
Inverts the given matcher.
|
static Matcher |
only(Object
Returns a matcher which matches objects equal to the given object.
|
static Matcher |
returns(Matcher
Returns a matcher which matches methods with matching return types.
|
static Matcher |
subclassesOf(Class
Returns a matcher which matches subclasses of the given type (as well as the given type).
|
public static Matcher<AnnotatedElement > annotatedWith(Class <? extends Annotation > annotationType)
public static Matcher<AnnotatedElement > annotatedWith(Annotation annotation)
public static Matcher<Class > subclassesOf(Class <?> superclass)
public static Matcher<Object > only(Object value)
public static Matcher<Object > identicalTo(Object value)
public static Matcher<Class > inPackage(Package targetPackage)
public static Matcher<Class > inSubpackage(String targetPackageName)
inPackage(), this matches classes from any classloader.