Interface ClassesThat<CONJUNCTION>
-
public interface ClassesThat<CONJUNCTION>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description CONJUNCTIONareAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)Matches classes annotated with a certain annotation, where matching annotations are determined by the supplied predicate.CONJUNCTIONareAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Matches classes annotated with a certain type of annotation.CONJUNCTIONareAnnotatedWith(java.lang.String annotationTypeName)Matches classes annotated with a certain type of annotation.CONJUNCTIONareAssignableFrom(DescribedPredicate<? super JavaClass> predicate)Matches classes assignable from a certain type matching the given predicate.CONJUNCTIONareAssignableFrom(java.lang.Class<?> type)Matches classes assignable from a certain type (compareClass.isAssignableFrom(Class)to terminology).CONJUNCTIONareAssignableFrom(java.lang.String typeName)Matches classes assignable from a certain type with the given type name.CONJUNCTIONareAssignableTo(DescribedPredicate<? super JavaClass> predicate)Matches classes assignable to a certain type matching the given predicate.CONJUNCTIONareAssignableTo(java.lang.Class<?> type)Matches classes assignable to a certain type (compareClass.isAssignableFrom(Class)to terminology).CONJUNCTIONareAssignableTo(java.lang.String typeName)Matches classes assignable to a certain type with the given type name.CONJUNCTIONareEnums()Matches enums.CONJUNCTIONareInterfaces()Matches interfaces.CONJUNCTIONareMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)Matches classes meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate.CONJUNCTIONareMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Matches classes meta-annotated with a certain type of annotation.CONJUNCTIONareMetaAnnotatedWith(java.lang.String annotationTypeName)Matches classes meta-annotated with a certain type of annotation.CONJUNCTIONareNotAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)Matches classes not annotated with a certain annotation, where matching annotations are determined by the supplied predicate.CONJUNCTIONareNotAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Matches classes not annotated with a certain type of annotation.CONJUNCTIONareNotAnnotatedWith(java.lang.String annotationTypeName)Matches classes not annotated with a certain type of annotation.CONJUNCTIONareNotAssignableFrom(DescribedPredicate<? super JavaClass> predicate)Matches classes not assignable from a certain type matching the given predicate.CONJUNCTIONareNotAssignableFrom(java.lang.Class<?> type)Matches classes not assignable from a certain type.CONJUNCTIONareNotAssignableFrom(java.lang.String typeName)Matches classes not assignable from a certain type with the given type name.CONJUNCTIONareNotAssignableTo(DescribedPredicate<? super JavaClass> predicate)Matches classes not assignable to a certain type matching the given predicate.CONJUNCTIONareNotAssignableTo(java.lang.Class<?> type)Matches classes not assignable to a certain type.CONJUNCTIONareNotAssignableTo(java.lang.String typeName)Matches classes not assignable to a certain type with the given type name.CONJUNCTIONareNotEnums()Matches everything except enums.CONJUNCTIONareNotInterfaces()Matches everything except interfaces.CONJUNCTIONareNotMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)Matches classes not meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate.CONJUNCTIONareNotMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Matches classes not meta-annotated with a certain type of annotation.CONJUNCTIONareNotMetaAnnotatedWith(java.lang.String annotationTypeName)Matches classes not meta-annotated with a certain type of annotation.CONJUNCTIONareNotPackagePrivate()Matches non-package private classes.CONJUNCTIONareNotPrivate()Matches non-private classes.CONJUNCTIONareNotProtected()Matches non-protected classes.CONJUNCTIONareNotPublic()Matches non-public classes.CONJUNCTIONarePackagePrivate()Matches package private classes.CONJUNCTIONarePrivate()Matches private classes.CONJUNCTIONareProtected()Matches protected classes.CONJUNCTIONarePublic()Matches public classes.CONJUNCTIONbelongToAnyOf(java.lang.Class... classes)Matches every class in the supplied list and any of their named/anonymous inner classes, no matter how deeply nested.CONJUNCTIONdoNotHaveFullyQualifiedName(java.lang.String name)Matches classes that do not have a certain fully qualified class name.CONJUNCTIONdoNotHaveModifier(JavaModifier modifier)Matches classes not having a certainJavaModifier(e.g.CONJUNCTIONdoNotHaveSimpleName(java.lang.String name)Matches classes that do not have a certain simple class name.CONJUNCTIONdoNotImplement(DescribedPredicate<? super JavaClass> predicate)Matches classes that do not implement a certain interface matching the given predicate.CONJUNCTIONdoNotImplement(java.lang.Class<?> type)Matches classes that do not implement a certain interface.CONJUNCTIONdoNotImplement(java.lang.String typeName)Matches classes that do not implement a certain interface with the given type name.CONJUNCTIONdontHaveFullyQualifiedName(java.lang.String name)Deprecated.Decided to consistently never use contractions -> usedoNotHaveFullyQualifiedName(String)CONJUNCTIONdontHaveModifier(JavaModifier modifier)Deprecated.Decided to consistently never use contractions -> usedoNotHaveModifier(JavaModifier)CONJUNCTIONdontHaveSimpleName(java.lang.String name)Deprecated.Decided to consistently never use contractions -> usedoNotHaveSimpleName(String)CONJUNCTIONdontImplement(DescribedPredicate<? super JavaClass> predicate)Deprecated.Decided to consistently never use contractions -> usedoNotImplement(DescribedPredicate)CONJUNCTIONdontImplement(java.lang.Class<?> type)Deprecated.Decided to consistently never use contractions -> usedoNotImplement(Class)CONJUNCTIONdontImplement(java.lang.String typeName)Deprecated.Decided to consistently never use contractions -> usedoNotImplement(String)CONJUNCTIONhaveFullyQualifiedName(java.lang.String name)Matches classes by their fully qualified class name.CONJUNCTIONhaveModifier(JavaModifier modifier)Matches classes having a certainJavaModifier(e.g.CONJUNCTIONhaveNameMatching(java.lang.String regex)Matches classes with a fully qualified class name matching a given regular expression.CONJUNCTIONhaveNameNotMatching(java.lang.String regex)Matches classes with a fully qualified class name not matching a given regular expression.CONJUNCTIONhaveSimpleName(java.lang.String name)Matches classes by their simple class name.CONJUNCTIONhaveSimpleNameContaining(java.lang.String infix)Matches classes with a simple class name containing the specified infix.CONJUNCTIONhaveSimpleNameEndingWith(java.lang.String suffix)Matches classes with a simple class name ending with a given suffix.CONJUNCTIONhaveSimpleNameNotContaining(java.lang.String infix)Matches classes with a simple class name not containing the specified infix.CONJUNCTIONhaveSimpleNameNotEndingWith(java.lang.String suffix)Matches classes with a simple class name not ending with a given suffix.CONJUNCTIONhaveSimpleNameNotStartingWith(java.lang.String prefix)Matches classes with a simple class name not starting with a given prefix.CONJUNCTIONhaveSimpleNameStartingWith(java.lang.String prefix)Matches classes with a simple class name starting with a given prefix.CONJUNCTIONimplement(DescribedPredicate<? super JavaClass> predicate)Matches classes that implement a certain interface matching the given predicate.CONJUNCTIONimplement(java.lang.Class<?> type)Matches classes that implement a certain interface.CONJUNCTIONimplement(java.lang.String typeName)Matches classes that implement a certain interface with the given type name.CONJUNCTIONresideInAnyPackage(java.lang.String... packageIdentifiers)Matches classes residing in a package matching any of the supplied package identifiers.CONJUNCTIONresideInAPackage(java.lang.String packageIdentifier)Matches classes residing in a package matching the supplied package identifier.CONJUNCTIONresideOutsideOfPackage(java.lang.String packageIdentifier)Matches classes not residing in a package matching the supplied package identifier.CONJUNCTIONresideOutsideOfPackages(java.lang.String... packageIdentifiers)Matches classes not residing in a package matching any of the supplied package identifiers.
-
-
-
Method Detail
-
haveFullyQualifiedName
@PublicAPI(usage=ACCESS) CONJUNCTION haveFullyQualifiedName(java.lang.String name)
Matches classes by their fully qualified class name.- Parameters:
name- The fully qualified class name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
dontHaveFullyQualifiedName
@Deprecated @PublicAPI(usage=ACCESS) CONJUNCTION dontHaveFullyQualifiedName(java.lang.String name)
Deprecated.Decided to consistently never use contractions -> usedoNotHaveFullyQualifiedName(String)
-
doNotHaveFullyQualifiedName
@PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveFullyQualifiedName(java.lang.String name)
Matches classes that do not have a certain fully qualified class name.- Parameters:
name- The fully qualified class name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleName
@PublicAPI(usage=ACCESS) CONJUNCTION haveSimpleName(java.lang.String name)
Matches classes by their simple class name.- Parameters:
name- The simple class name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
dontHaveSimpleName
@Deprecated @PublicAPI(usage=ACCESS) CONJUNCTION dontHaveSimpleName(java.lang.String name)
Deprecated.Decided to consistently never use contractions -> usedoNotHaveSimpleName(String)
-
doNotHaveSimpleName
@PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveSimpleName(java.lang.String name)
Matches classes that do not have a certain simple class name.- Parameters:
name- The simple class name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameMatching
@PublicAPI(usage=ACCESS) CONJUNCTION haveNameMatching(java.lang.String regex)
Matches classes with a fully qualified class name matching a given regular expression.- Parameters:
regex- A regular expression- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameNotMatching
@PublicAPI(usage=ACCESS) CONJUNCTION haveNameNotMatching(java.lang.String regex)
Matches classes with a fully qualified class name not matching a given regular expression.- Parameters:
regex- A regular expression- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameStartingWith
@PublicAPI(usage=ACCESS) CONJUNCTION haveSimpleNameStartingWith(java.lang.String prefix)
Matches classes with a simple class name starting with a given prefix.- Parameters:
prefix- A prefix the simple class name should start with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameNotStartingWith
@PublicAPI(usage=ACCESS) CONJUNCTION haveSimpleNameNotStartingWith(java.lang.String prefix)
Matches classes with a simple class name not starting with a given prefix.- Parameters:
prefix- A prefix the simple class name should not start with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameContaining
@PublicAPI(usage=ACCESS) CONJUNCTION haveSimpleNameContaining(java.lang.String infix)
Matches classes with a simple class name containing the specified infix.- Parameters:
infix- An infix the simple class name should contain- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameNotContaining
@PublicAPI(usage=ACCESS) CONJUNCTION haveSimpleNameNotContaining(java.lang.String infix)
Matches classes with a simple class name not containing the specified infix.- Parameters:
infix- An infix the simple class name should not contain- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameEndingWith
@PublicAPI(usage=ACCESS) CONJUNCTION haveSimpleNameEndingWith(java.lang.String suffix)
Matches classes with a simple class name ending with a given suffix.- Parameters:
suffix- A suffix the simple class name should end with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameNotEndingWith
@PublicAPI(usage=ACCESS) CONJUNCTION haveSimpleNameNotEndingWith(java.lang.String suffix)
Matches classes with a simple class name not ending with a given suffix.- Parameters:
suffix- A suffix the simple class name should not end with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
resideInAPackage
@PublicAPI(usage=ACCESS) CONJUNCTION resideInAPackage(java.lang.String packageIdentifier)
Matches classes residing in a package matching the supplied package identifier.- Parameters:
packageIdentifier- A string identifying packages, for details seePackageMatcher- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
resideInAnyPackage
@PublicAPI(usage=ACCESS) CONJUNCTION resideInAnyPackage(java.lang.String... packageIdentifiers)
Matches classes residing in a package matching any of the supplied package identifiers.- Parameters:
packageIdentifiers- Strings identifying packages, for details seePackageMatcher- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
resideOutsideOfPackage
@PublicAPI(usage=ACCESS) CONJUNCTION resideOutsideOfPackage(java.lang.String packageIdentifier)
Matches classes not residing in a package matching the supplied package identifier.- Parameters:
packageIdentifier- A string identifying packages, for details seePackageMatcher- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
resideOutsideOfPackages
@PublicAPI(usage=ACCESS) CONJUNCTION resideOutsideOfPackages(java.lang.String... packageIdentifiers)
Matches classes not residing in a package matching any of the supplied package identifiers.- Parameters:
packageIdentifiers- Strings identifying packages, for details seePackageMatcher- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePublic
@PublicAPI(usage=ACCESS) CONJUNCTION arePublic()
Matches public classes.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPublic
@PublicAPI(usage=ACCESS) CONJUNCTION areNotPublic()
Matches non-public classes.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areProtected
@PublicAPI(usage=ACCESS) CONJUNCTION areProtected()
Matches protected classes.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotProtected
@PublicAPI(usage=ACCESS) CONJUNCTION areNotProtected()
Matches non-protected classes.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePackagePrivate
@PublicAPI(usage=ACCESS) CONJUNCTION arePackagePrivate()
Matches package private classes.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPackagePrivate
@PublicAPI(usage=ACCESS) CONJUNCTION areNotPackagePrivate()
Matches non-package private classes.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePrivate
@PublicAPI(usage=ACCESS) CONJUNCTION arePrivate()
Matches private classes.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPrivate
@PublicAPI(usage=ACCESS) CONJUNCTION areNotPrivate()
Matches non-private classes.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveModifier
@PublicAPI(usage=ACCESS) CONJUNCTION haveModifier(JavaModifier modifier)
Matches classes having a certainJavaModifier(e.g.JavaModifier.ABSTRACT).- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
dontHaveModifier
@Deprecated @PublicAPI(usage=ACCESS) CONJUNCTION dontHaveModifier(JavaModifier modifier)
Deprecated.Decided to consistently never use contractions -> usedoNotHaveModifier(JavaModifier)
-
doNotHaveModifier
@PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveModifier(JavaModifier modifier)
Matches classes not having a certainJavaModifier(e.g.JavaModifier.ABSTRACT).- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Matches classes annotated with a certain type of annotation.- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Matches classes not annotated with a certain type of annotation.- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areAnnotatedWith(java.lang.String annotationTypeName)
Matches classes annotated with a certain type of annotation.- Parameters:
annotationTypeName- Fully qualified class name of a specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAnnotatedWith(java.lang.String annotationTypeName)
Matches classes not annotated with a certain type of annotation.- Parameters:
annotationTypeName- Fully qualified class name of a specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Matches classes annotated with a certain annotation, where matching annotations are determined by the supplied predicate.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Matches classes not annotated with a certain annotation, where matching annotations are determined by the supplied predicate.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Matches classes meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Matches classes not meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areMetaAnnotatedWith(java.lang.String annotationTypeName)
Matches classes meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.- Parameters:
annotationTypeName- Fully qualified class name of a specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotMetaAnnotatedWith(java.lang.String annotationTypeName)
Matches classes not meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.- Parameters:
annotationTypeName- Fully qualified class name of a specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Matches classes meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate. A meta-annotation is an annotation that is declared on another annotation.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Matches classes not meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate. A meta-annotation is an annotation that is declared on another annotation.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
implement
@PublicAPI(usage=ACCESS) CONJUNCTION implement(java.lang.Class<?> type)
Matches classes that implement a certain interface.- Parameters:
type- An interface type matching classes must implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
dontImplement
@Deprecated @PublicAPI(usage=ACCESS) CONJUNCTION dontImplement(java.lang.Class<?> type)
Deprecated.Decided to consistently never use contractions -> usedoNotImplement(Class)
-
doNotImplement
@PublicAPI(usage=ACCESS) CONJUNCTION doNotImplement(java.lang.Class<?> type)
Matches classes that do not implement a certain interface. This is the negation ofimplement(Class).- Parameters:
type- An interface type matching classes must not implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
implement
@PublicAPI(usage=ACCESS) CONJUNCTION implement(java.lang.String typeName)
Matches classes that implement a certain interface with the given type name. This is equivalent toimplement(Class), but does not depend on having a certain type on the classpath.- Parameters:
typeName- Name of an interface type matching classes must implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
dontImplement
@Deprecated @PublicAPI(usage=ACCESS) CONJUNCTION dontImplement(java.lang.String typeName)
Deprecated.Decided to consistently never use contractions -> usedoNotImplement(String)
-
doNotImplement
@PublicAPI(usage=ACCESS) CONJUNCTION doNotImplement(java.lang.String typeName)
Matches classes that do not implement a certain interface with the given type name. This is equivalent todoNotImplement(Class), but does not depend on having a certain type on the classpath.- Parameters:
typeName- Name of an interface type matching classes must not implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
implement
@PublicAPI(usage=ACCESS) CONJUNCTION implement(DescribedPredicate<? super JavaClass> predicate)
Matches classes that implement a certain interface matching the given predicate. For example, a call withHasName.Predicates.name(String)would be equivalent toimplement(String), but the approach is a lot more generic.- Parameters:
predicate- A predicate identifying interfaces matching classes must implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
dontImplement
@Deprecated @PublicAPI(usage=ACCESS) CONJUNCTION dontImplement(DescribedPredicate<? super JavaClass> predicate)
Deprecated.Decided to consistently never use contractions -> usedoNotImplement(DescribedPredicate)
-
doNotImplement
@PublicAPI(usage=ACCESS) CONJUNCTION doNotImplement(DescribedPredicate<? super JavaClass> predicate)
Matches classes that do not implement a certain interface matching the given predicate. This is the negation ofimplement(DescribedPredicate).- Parameters:
predicate- A predicate identifying interfaces matching classes must not implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableTo
@PublicAPI(usage=ACCESS) CONJUNCTION areAssignableTo(java.lang.Class<?> type)
Matches classes assignable to a certain type (compareClass.isAssignableFrom(Class)to terminology). A simple example for this predicate would beassignableTo(Object.class).apply(importedStringClass); // --> returns true assignableTo(String.class).apply(importedStringClass); // --> returns true assignableTo(List.class).apply(importedStringClass); // --> returns false- Parameters:
type- An upper type bound to match imported classes against (imported subtypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableTo
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAssignableTo(java.lang.Class<?> type)
Matches classes not assignable to a certain type. This is the negation ofareAssignableTo(Class).- Parameters:
type- An upper type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableTo
@PublicAPI(usage=ACCESS) CONJUNCTION areAssignableTo(java.lang.String typeName)
Matches classes assignable to a certain type with the given type name. This is equivalent toareAssignableTo(Class), but does not depend on having a certain type on the classpath.- Parameters:
typeName- Name of an upper type bound to match imported classes against (imported subtypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableTo
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAssignableTo(java.lang.String typeName)
Matches classes not assignable to a certain type with the given type name. This is equivalent toareNotAssignableTo(Class), but does not depend on having a certain type on the classpath.- Parameters:
typeName- Name of an upper type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableTo
@PublicAPI(usage=ACCESS) CONJUNCTION areAssignableTo(DescribedPredicate<? super JavaClass> predicate)
Matches classes assignable to a certain type matching the given predicate. For example, a call withHasName.Predicates.name(String)would be equivalent toareAssignableTo(String), but the approach is a lot more generic.- Parameters:
predicate- A predicate identifying an upper type bound to match imported classes against (imported subtypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableTo
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAssignableTo(DescribedPredicate<? super JavaClass> predicate)
Matches classes not assignable to a certain type matching the given predicate. This is the negation ofareAssignableTo(DescribedPredicate).- Parameters:
predicate- A predicate identifying an upper type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableFrom
@PublicAPI(usage=ACCESS) CONJUNCTION areAssignableFrom(java.lang.Class<?> type)
Matches classes assignable from a certain type (compareClass.isAssignableFrom(Class)to terminology). This is roughly equivalent to the use of reflection:
A simple example for this predicate would besomeClass.class.isAssignableFrom(type);assignableFrom(ArrayList.class).apply(importedArrayListClass); // --> returns true assignableFrom(ArrayList.class).apply(importedListClass); // --> returns true assignableFrom(ArrayList.class).apply(importedStringClass); // --> returns false- Parameters:
type- A lower type bound to match imported classes against (imported supertypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableFrom
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAssignableFrom(java.lang.Class<?> type)
Matches classes not assignable from a certain type. This is the negation ofareAssignableFrom(Class).- Parameters:
type- A lower type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableFrom
@PublicAPI(usage=ACCESS) CONJUNCTION areAssignableFrom(java.lang.String typeName)
Matches classes assignable from a certain type with the given type name. This is equivalent toareAssignableFrom(Class), but does not depend on having a certain type on the classpath.- Parameters:
typeName- Name of a lower type bound to match imported classes against (imported supertypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableFrom
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAssignableFrom(java.lang.String typeName)
Matches classes not assignable from a certain type with the given type name. This is equivalent toareNotAssignableFrom(Class), but does not depend on having a certain type on the classpath.- Parameters:
typeName- Name of a lower type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableFrom
@PublicAPI(usage=ACCESS) CONJUNCTION areAssignableFrom(DescribedPredicate<? super JavaClass> predicate)
Matches classes assignable from a certain type matching the given predicate. For example, a call withHasName.Predicates.name(String)would be equivalent toareAssignableFrom(String), but the approach is a lot more generic.- Parameters:
predicate- A predicate identifying a lower type bound to match imported classes against (imported supertypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableFrom
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAssignableFrom(DescribedPredicate<? super JavaClass> predicate)
Matches classes not assignable from a certain type matching the given predicate. This is the negation ofareAssignableFrom(DescribedPredicate).- Parameters:
predicate- A predicate identifying a lower type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areInterfaces
@PublicAPI(usage=ACCESS) CONJUNCTION areInterfaces()
Matches interfaces.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotInterfaces
@PublicAPI(usage=ACCESS) CONJUNCTION areNotInterfaces()
Matches everything except interfaces.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areEnums
@PublicAPI(usage=ACCESS) CONJUNCTION areEnums()
Matches enums.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotEnums
@PublicAPI(usage=ACCESS) CONJUNCTION areNotEnums()
Matches everything except enums.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
belongToAnyOf
@PublicAPI(usage=ACCESS) CONJUNCTION belongToAnyOf(java.lang.Class... classes)
Matches every class in the supplied list and any of their named/anonymous inner classes, no matter how deeply nested. E.g. consider
Thenclass Outer { class Inner { class EvenMoreInner { } } }belongToAnyOf(Outer.class)would match theJavaClassOuterbut alsoInnerandEvenMoreInner. Likewise would hold for any anonymous inner classes.- Parameters:
classes- List ofClassobjects.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
-