public interface ClassesThat<CONJUNCTION>
Modifier and Type | Method and Description |
---|---|
CONJUNCTION |
areAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Matches classes annotated with a certain type of annotation.
|
CONJUNCTION |
areAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Matches classes annotated with a certain annotation, where matching annotations are
determined by the supplied predicate.
|
CONJUNCTION |
areAnnotatedWith(java.lang.String annotationTypeName)
Matches classes annotated with a certain type of annotation.
|
CONJUNCTION |
areAssignableFrom(java.lang.Class<?> type)
Matches classes assignable from a certain type (compare
Class.isAssignableFrom(Class) to terminology). |
CONJUNCTION |
areAssignableFrom(DescribedPredicate<? super JavaClass> predicate)
Matches classes assignable from a certain type matching the given predicate.
|
CONJUNCTION |
areAssignableFrom(java.lang.String typeName)
Matches classes assignable from a certain type with the given type name.
|
CONJUNCTION |
areAssignableTo(java.lang.Class<?> type)
Matches classes assignable to a certain type (compare
Class.isAssignableFrom(Class) to terminology). |
CONJUNCTION |
areAssignableTo(DescribedPredicate<? super JavaClass> predicate)
Matches classes assignable to a certain type matching the given predicate.
|
CONJUNCTION |
areAssignableTo(java.lang.String typeName)
Matches classes assignable to a certain type with the given type name.
|
CONJUNCTION |
areInterfaces()
Matches interfaces.
|
CONJUNCTION |
areNotAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Matches classes not annotated with a certain type of annotation.
|
CONJUNCTION |
areNotAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Matches classes not annotated with a certain annotation, where matching annotations are
determined by the supplied predicate.
|
CONJUNCTION |
areNotAnnotatedWith(java.lang.String annotationTypeName)
Matches classes not annotated with a certain type of annotation.
|
CONJUNCTION |
areNotAssignableFrom(java.lang.Class<?> type)
Matches classes not assignable from a certain type.
|
CONJUNCTION |
areNotAssignableFrom(DescribedPredicate<? super JavaClass> predicate)
Matches classes not assignable from a certain type matching the given predicate.
|
CONJUNCTION |
areNotAssignableFrom(java.lang.String typeName)
Matches classes not assignable from a certain type with the given type name.
|
CONJUNCTION |
areNotAssignableTo(java.lang.Class<?> type)
Matches classes not assignable to a certain type.
|
CONJUNCTION |
areNotAssignableTo(DescribedPredicate<? super JavaClass> predicate)
Matches classes not assignable to a certain type matching the given predicate.
|
CONJUNCTION |
areNotAssignableTo(java.lang.String typeName)
Matches classes not assignable to a certain type with the given type name.
|
CONJUNCTION |
areNotInterfaces()
Matches everything except interfaces.
|
CONJUNCTION |
areNotPackagePrivate()
Matches non-package private classes.
|
CONJUNCTION |
areNotPrivate()
Matches non-private classes.
|
CONJUNCTION |
areNotProtected()
Matches non-protected classes.
|
CONJUNCTION |
areNotPublic()
Matches non-public classes.
|
CONJUNCTION |
arePackagePrivate()
Matches package private classes.
|
CONJUNCTION |
arePrivate()
Matches private classes.
|
CONJUNCTION |
areProtected()
Matches protected classes.
|
CONJUNCTION |
arePublic()
Matches public classes.
|
CONJUNCTION |
dontHaveFullyQualifiedName(java.lang.String name)
Matches classes that don't have a certain fully qualified class name.
|
CONJUNCTION |
dontHaveModifier(JavaModifier modifier)
Matches classes not having a certain
JavaModifier (e.g. |
CONJUNCTION |
dontHaveSimpleName(java.lang.String name)
Matches classes that don't have a certain simple class name.
|
CONJUNCTION |
dontImplement(java.lang.Class<?> type)
Matches classes that don't implement a certain interface.
|
CONJUNCTION |
dontImplement(DescribedPredicate<? super JavaClass> predicate)
Matches classes that don't implement a certain interface matching the given predicate.
|
CONJUNCTION |
dontImplement(java.lang.String typeName)
Matches classes that don't implement a certain interface with the given type name.
|
CONJUNCTION |
haveFullyQualifiedName(java.lang.String name)
Matches classes by their fully qualified class name.
|
CONJUNCTION |
haveModifier(JavaModifier modifier)
Matches classes having a certain
JavaModifier (e.g. |
CONJUNCTION |
haveNameMatching(java.lang.String regex)
Matches classes with a fully qualified class name matching a given regular expression.
|
CONJUNCTION |
haveNameNotMatching(java.lang.String regex)
Matches classes with a fully qualified class name not matching a given regular expression.
|
CONJUNCTION |
haveSimpleName(java.lang.String name)
Matches classes by their simple class name.
|
CONJUNCTION |
haveSimpleNameContaining(java.lang.String infix)
Matches classes with a simple class name containing the specified infix.
|
CONJUNCTION |
haveSimpleNameEndingWith(java.lang.String suffix)
Matches classes with a simple class name ending with a given suffix.
|
CONJUNCTION |
haveSimpleNameNotContaining(java.lang.String infix)
Matches classes with a simple class name not containing the specified infix.
|
CONJUNCTION |
haveSimpleNameNotEndingWith(java.lang.String suffix)
Matches classes with a simple class name not ending with a given suffix.
|
CONJUNCTION |
haveSimpleNameNotStartingWith(java.lang.String prefix)
Matches classes with a simple class name not starting with a given prefix.
|
CONJUNCTION |
haveSimpleNameStartingWith(java.lang.String prefix)
Matches classes with a simple class name starting with a given prefix.
|
CONJUNCTION |
implement(java.lang.Class<?> type)
Matches classes that implement a certain interface.
|
CONJUNCTION |
implement(DescribedPredicate<? super JavaClass> predicate)
Matches classes that implement a certain interface matching the given predicate.
|
CONJUNCTION |
implement(java.lang.String typeName)
Matches classes that implement a certain interface with the given type name.
|
CONJUNCTION |
resideInAnyPackage(java.lang.String... packageIdentifiers)
Matches classes residing in a package matching any of the supplied package identifiers.
|
CONJUNCTION |
resideInAPackage(java.lang.String packageIdentifier)
Matches classes residing in a package matching the supplied package identifier.
|
CONJUNCTION |
resideOutsideOfPackage(java.lang.String packageIdentifier)
Matches classes not residing in a package matching the supplied package identifier.
|
CONJUNCTION |
resideOutsideOfPackages(java.lang.String... packageIdentifiers)
Matches classes not residing in a package matching any of the supplied package identifiers.
|
CONJUNCTION haveFullyQualifiedName(java.lang.String name)
name
- The fully qualified class nameCONJUNCTION dontHaveFullyQualifiedName(java.lang.String name)
name
- The fully qualified class nameCONJUNCTION haveSimpleName(java.lang.String name)
name
- The simple class nameCONJUNCTION dontHaveSimpleName(java.lang.String name)
name
- The simple class nameCONJUNCTION haveNameMatching(java.lang.String regex)
regex
- A regular expressionCONJUNCTION haveNameNotMatching(java.lang.String regex)
regex
- A regular expressionCONJUNCTION haveSimpleNameStartingWith(java.lang.String prefix)
prefix
- A prefix the simple class name should start withCONJUNCTION haveSimpleNameNotStartingWith(java.lang.String prefix)
prefix
- A prefix the simple class name should not start withCONJUNCTION haveSimpleNameContaining(java.lang.String infix)
infix
- An infix the simple class name should containCONJUNCTION haveSimpleNameNotContaining(java.lang.String infix)
infix
- An infix the simple class name should not containCONJUNCTION haveSimpleNameEndingWith(java.lang.String suffix)
suffix
- A suffix the simple class name should end withCONJUNCTION haveSimpleNameNotEndingWith(java.lang.String suffix)
suffix
- A suffix the simple class name should not end withCONJUNCTION resideInAPackage(java.lang.String packageIdentifier)
packageIdentifier
- A string identifying packages, for details see PackageMatcher
CONJUNCTION resideInAnyPackage(java.lang.String... packageIdentifiers)
packageIdentifiers
- Strings identifying packages, for details see PackageMatcher
CONJUNCTION resideOutsideOfPackage(java.lang.String packageIdentifier)
packageIdentifier
- A string identifying packages, for details see PackageMatcher
CONJUNCTION resideOutsideOfPackages(java.lang.String... packageIdentifiers)
packageIdentifiers
- Strings identifying packages, for details see PackageMatcher
CONJUNCTION arePublic()
CONJUNCTION areNotPublic()
CONJUNCTION areProtected()
CONJUNCTION areNotProtected()
CONJUNCTION arePackagePrivate()
CONJUNCTION areNotPackagePrivate()
CONJUNCTION arePrivate()
CONJUNCTION areNotPrivate()
CONJUNCTION haveModifier(JavaModifier modifier)
JavaModifier
(e.g. JavaModifier.ABSTRACT
).CONJUNCTION dontHaveModifier(JavaModifier modifier)
JavaModifier
(e.g. JavaModifier.ABSTRACT
).CONJUNCTION areAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType
- Specific type of Annotation
CONJUNCTION areNotAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType
- Specific type of Annotation
CONJUNCTION areAnnotatedWith(java.lang.String annotationTypeName)
annotationTypeName
- Fully qualified class name of a specific type of Annotation
CONJUNCTION areNotAnnotatedWith(java.lang.String annotationTypeName)
annotationTypeName
- Fully qualified class name of a specific type of Annotation
CONJUNCTION areAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
predicate
- A predicate defining matching JavaAnnotations
CONJUNCTION areNotAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
predicate
- A predicate defining matching JavaAnnotations
CONJUNCTION implement(java.lang.Class<?> type)
type
- An interface type matching classes must implementCONJUNCTION dontImplement(java.lang.Class<?> type)
implement(Class)
.type
- An interface type matching classes must not implementCONJUNCTION implement(java.lang.String typeName)
implement(Class)
, but doesn't depend on having a certain type on the classpath.typeName
- Name of an interface type matching classes must implementCONJUNCTION dontImplement(java.lang.String typeName)
dontImplement(Class)
, but doesn't depend on having a certain
type on the classpath.typeName
- Name of an interface type matching classes must not implementCONJUNCTION implement(DescribedPredicate<? super JavaClass> predicate)
HasName.Predicates.name(String)
would be equivalent to
implement(String)
, but the approach is a lot more generic.predicate
- A predicate identifying interfaces matching classes must implementCONJUNCTION dontImplement(DescribedPredicate<? super JavaClass> predicate)
implement(DescribedPredicate)
.predicate
- A predicate identifying interfaces matching classes must not implementCONJUNCTION areAssignableTo(java.lang.Class<?> type)
Class.isAssignableFrom(Class)
to terminology).
A simple example for this predicate would be
assignableTo(Object.class).apply(importedStringClass); // --> returns true
assignableTo(String.class).apply(importedStringClass); // --> returns true
assignableTo(List.class).apply(importedStringClass); // --> returns false
type
- An upper type bound to match imported classes against (imported subtypes will match)CONJUNCTION areNotAssignableTo(java.lang.Class<?> type)
areAssignableTo(Class)
.type
- An upper type bound imported classes should NOT haveCONJUNCTION areAssignableTo(java.lang.String typeName)
areAssignableTo(Class)
, but doesn't depend on having a certain type on the classpath.typeName
- Name of an upper type bound to match imported classes against (imported subtypes will match)CONJUNCTION areNotAssignableTo(java.lang.String typeName)
areNotAssignableTo(Class)
, but doesn't depend on having a certain
type on the classpath.typeName
- Name of an upper type bound imported classes should NOT haveCONJUNCTION areAssignableTo(DescribedPredicate<? super JavaClass> predicate)
HasName.Predicates.name(String)
would be equivalent to
areAssignableTo(String)
, but the approach is a lot more generic.predicate
- A predicate identifying an upper type bound to match imported classes against
(imported subtypes will match)CONJUNCTION areNotAssignableTo(DescribedPredicate<? super JavaClass> predicate)
areAssignableTo(DescribedPredicate)
.predicate
- A predicate identifying an upper type bound imported classes should NOT haveCONJUNCTION areAssignableFrom(java.lang.Class<?> type)
Class.isAssignableFrom(Class)
to terminology).
This is roughly equivalent to the use of reflection:
someClass.class.isAssignableFrom(type);
A simple example for this predicate would be
assignableFrom(ArrayList.class).apply(importedArrayListClass); // --> returns true
assignableFrom(ArrayList.class).apply(importedListClass); // --> returns true
assignableFrom(ArrayList.class).apply(importedStringClass); // --> returns false
type
- A lower type bound to match imported classes against (imported supertypes will match)CONJUNCTION areNotAssignableFrom(java.lang.Class<?> type)
areAssignableFrom(Class)
.type
- A lower type bound imported classes should NOT haveCONJUNCTION areAssignableFrom(java.lang.String typeName)
areAssignableFrom(Class)
, but doesn't depend on having a certain type on the classpath.typeName
- Name of a lower type bound to match imported classes against (imported supertypes will match)CONJUNCTION areNotAssignableFrom(java.lang.String typeName)
areNotAssignableFrom(Class)
, but doesn't depend on having a certain
type on the classpath.typeName
- Name of a lower type bound imported classes should NOT haveCONJUNCTION areAssignableFrom(DescribedPredicate<? super JavaClass> predicate)
HasName.Predicates.name(String)
would be equivalent to
areAssignableFrom(String)
, but the approach is a lot more generic.predicate
- A predicate identifying a lower type bound to match imported classes against
(imported supertypes will match)CONJUNCTION areNotAssignableFrom(DescribedPredicate<? super JavaClass> predicate)
areAssignableFrom(DescribedPredicate)
.predicate
- A predicate identifying a lower type bound imported classes should NOT haveCONJUNCTION areInterfaces()
CONJUNCTION areNotInterfaces()