Interface MembersShould<CONJUNCTION extends MembersShouldConjunction<?>>
-
- All Known Subinterfaces:
CodeUnitsShould<CONJUNCTION>,FieldsShould<CONJUNCTION>,MethodsShould<CONJUNCTION>
public interface MembersShould<CONJUNCTION extends MembersShouldConjunction<?>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CONJUNCTIONbeAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)Asserts that members are annotated with an annotation matching the supplied predicate.CONJUNCTIONbeAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Asserts that members are annotated with a certain type of annotation.CONJUNCTIONbeAnnotatedWith(java.lang.String annotationTypeName)Asserts that members are annotated with a certain type of annotation.CONJUNCTIONbeDeclaredIn(java.lang.Class<?> javaClass)Asserts that members are declared within the supplied class.CONJUNCTIONbeDeclaredIn(java.lang.String className)Asserts that members are declared within a class of the supplied class name.ClassesThat<CONJUNCTION>beDeclaredInClassesThat()Allows to assert that members are declared within a certain class.CONJUNCTIONbeDeclaredInClassesThat(DescribedPredicate<? super JavaClass> predicate)Asserts that members are declared within a class matching the supplied predicate.CONJUNCTIONbeMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)Asserts that members are meta-annotated with an annotation matching the supplied predicate.CONJUNCTIONbeMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Asserts that members are meta-annotated with a certain type of annotation.CONJUNCTIONbeMetaAnnotatedWith(java.lang.String annotationTypeName)Asserts that members are meta-annotated with a certain type of annotation.CONJUNCTIONbePackagePrivate()Asserts that members are package private.CONJUNCTIONbePrivate()Asserts that members are private.CONJUNCTIONbeProtected()Asserts that members are protected.CONJUNCTIONbePublic()Asserts that members are public.CONJUNCTIONhaveFullName(java.lang.String fullName)Asserts that members have a certain full name (compareJavaField.getFullName()andJavaCodeUnit.getFullName()).CONJUNCTIONhaveFullNameMatching(java.lang.String regex)Asserts that members have a full name matching a given regular expression (compareJavaField.getFullName()andJavaCodeUnit.getFullName()).CONJUNCTIONhaveFullNameNotMatching(java.lang.String regex)Asserts that members have a full name not matching a given regular expression (compareJavaField.getFullName()andJavaCodeUnit.getFullName()).CONJUNCTIONhaveModifier(JavaModifier modifier)Asserts that members have a certainJavaModifier(e.g.CONJUNCTIONhaveName(java.lang.String name)Asserts that members have a certain name (i.e.CONJUNCTIONhaveNameMatching(java.lang.String regex)Asserts that members have a name (i.e.CONJUNCTIONhaveNameNotMatching(java.lang.String regex)Asserts that members have a name (i.e.CONJUNCTIONnotBeAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)Asserts that members are not annotated with an annotation matching the supplied predicate.CONJUNCTIONnotBeAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Asserts that members are not annotated with a certain type of annotation.CONJUNCTIONnotBeAnnotatedWith(java.lang.String annotationTypeName)Asserts that members are not annotated with a certain type of annotation.CONJUNCTIONnotBeDeclaredIn(java.lang.Class<?> javaClass)Asserts that members are not declared within the supplied class.CONJUNCTIONnotBeDeclaredIn(java.lang.String className)Asserts that members are not declared within a class of the supplied class name.CONJUNCTIONnotBeMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)Asserts that members are not meta-annotated with an annotation matching the supplied predicate.CONJUNCTIONnotBeMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)Asserts that members are not meta-annotated with a certain type of annotation.CONJUNCTIONnotBeMetaAnnotatedWith(java.lang.String annotationTypeName)Asserts that members are not meta-annotated with a certain type of annotation.CONJUNCTIONnotBePackagePrivate()Asserts that members are non-package private.CONJUNCTIONnotBePrivate()Asserts that members are non-private.CONJUNCTIONnotBeProtected()Asserts that members are non-protected.CONJUNCTIONnotBePublic()Asserts that members are non-public.CONJUNCTIONnotHaveFullName(java.lang.String fullName)Asserts that members do not have a certain full name (compareJavaField.getFullName()andJavaCodeUnit.getFullName()).CONJUNCTIONnotHaveModifier(JavaModifier modifier)Asserts that members do not have a certainJavaModifier(e.g.CONJUNCTIONnotHaveName(java.lang.String name)Asserts that members do not have a certain name (i.e.
-
-
-
Method Detail
-
haveName
@PublicAPI(usage=ACCESS) CONJUNCTION haveName(java.lang.String name)
Asserts that members have a certain name (i.e. field name, method name orJavaConstructor.CONSTRUCTOR_NAME).- Parameters:
name- The member name- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notHaveName
@PublicAPI(usage=ACCESS) CONJUNCTION notHaveName(java.lang.String name)
Asserts that members do not have a certain name (i.e. field name, method name orJavaConstructor.CONSTRUCTOR_NAME).- Parameters:
name- The member name- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
haveNameMatching
@PublicAPI(usage=ACCESS) CONJUNCTION haveNameMatching(java.lang.String regex)
Asserts that members have a name (i.e. field name, method name orJavaConstructor.CONSTRUCTOR_NAME) matching a given regular expression.- Parameters:
regex- A regular expression- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
haveNameNotMatching
@PublicAPI(usage=ACCESS) CONJUNCTION haveNameNotMatching(java.lang.String regex)
Asserts that members have a name (i.e. field name, method name orJavaConstructor.CONSTRUCTOR_NAME) not matching a given regular expression.- Parameters:
regex- A regular expression- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
haveFullName
@PublicAPI(usage=ACCESS) CONJUNCTION haveFullName(java.lang.String fullName)
Asserts that members have a certain full name (compareJavaField.getFullName()andJavaCodeUnit.getFullName()).- Parameters:
fullName- The member's full name- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notHaveFullName
@PublicAPI(usage=ACCESS) CONJUNCTION notHaveFullName(java.lang.String fullName)
Asserts that members do not have a certain full name (compareJavaField.getFullName()andJavaCodeUnit.getFullName()).- Parameters:
fullName- The member's full name- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
haveFullNameMatching
@PublicAPI(usage=ACCESS) CONJUNCTION haveFullNameMatching(java.lang.String regex)
Asserts that members have a full name matching a given regular expression (compareJavaField.getFullName()andJavaCodeUnit.getFullName()).- Parameters:
regex- A regular expression- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
haveFullNameNotMatching
@PublicAPI(usage=ACCESS) CONJUNCTION haveFullNameNotMatching(java.lang.String regex)
Asserts that members have a full name not matching a given regular expression (compareJavaField.getFullName()andJavaCodeUnit.getFullName()).- Parameters:
regex- A regular expression- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
bePublic
@PublicAPI(usage=ACCESS) CONJUNCTION bePublic()
Asserts that members are public.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBePublic
@PublicAPI(usage=ACCESS) CONJUNCTION notBePublic()
Asserts that members are non-public.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beProtected
@PublicAPI(usage=ACCESS) CONJUNCTION beProtected()
Asserts that members are protected.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeProtected
@PublicAPI(usage=ACCESS) CONJUNCTION notBeProtected()
Asserts that members are non-protected.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
bePackagePrivate
@PublicAPI(usage=ACCESS) CONJUNCTION bePackagePrivate()
Asserts that members are package private.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBePackagePrivate
@PublicAPI(usage=ACCESS) CONJUNCTION notBePackagePrivate()
Asserts that members are non-package private.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
bePrivate
@PublicAPI(usage=ACCESS) CONJUNCTION bePrivate()
Asserts that members are private.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBePrivate
@PublicAPI(usage=ACCESS) CONJUNCTION notBePrivate()
Asserts that members are non-private.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
haveModifier
@PublicAPI(usage=ACCESS) CONJUNCTION haveModifier(JavaModifier modifier)
Asserts that members have a certainJavaModifier(e.g.JavaModifier.ABSTRACT).- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notHaveModifier
@PublicAPI(usage=ACCESS) CONJUNCTION notHaveModifier(JavaModifier modifier)
Asserts that members do not have a certainJavaModifier(e.g.JavaModifier.ABSTRACT).- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION beAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Asserts that members are annotated with a certain type of annotation.- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION notBeAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Asserts that members are not annotated with a certain type of annotation.- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION beAnnotatedWith(java.lang.String annotationTypeName)
Asserts that members are annotated with a certain type of annotation.- Parameters:
annotationTypeName- Fully qualified class name of a specific type ofAnnotation- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION notBeAnnotatedWith(java.lang.String annotationTypeName)
Asserts that members are not annotated with a certain type of annotation.- Parameters:
annotationTypeName- Fully qualified class name of a specific type ofAnnotation- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION beAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Asserts that members are annotated with an annotation matching the supplied predicate.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION notBeAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Asserts that members are not annotated with an annotation matching the supplied predicate.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION beMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Asserts that members are 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 element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION notBeMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Asserts that members are 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 element that can either be used as working rule, or to continue specifying a more complex rule
-
beMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION beMetaAnnotatedWith(java.lang.String annotationTypeName)
Asserts that members are 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 element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION notBeMetaAnnotatedWith(java.lang.String annotationTypeName)
Asserts that members are 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 element that can either be used as working rule, or to continue specifying a more complex rule
-
beMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION beMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Asserts that members are meta-annotated with an annotation matching the supplied predicate. A meta-annotation is an annotation that is declared on another annotation.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION notBeMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Asserts that members are not meta-annotated with an annotation matching the supplied predicate. A meta-annotation is an annotation that is declared on another annotation.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beDeclaredIn
@PublicAPI(usage=ACCESS) CONJUNCTION beDeclaredIn(java.lang.Class<?> javaClass)
Asserts that members are declared within the supplied class.
E.g.
would be violated bymembers().should().beDeclaredIn(Example.class)someFieldinclass AnyOther { Object someField; }- Parameters:
javaClass- A class that members should be declared in- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeDeclaredIn
@PublicAPI(usage=ACCESS) CONJUNCTION notBeDeclaredIn(java.lang.Class<?> javaClass)
Asserts that members are not declared within the supplied class.
E.g.
would be violated bymembers().should().notBeDeclaredIn(Example.class)someFieldinclass Example { Object someField; }- Parameters:
javaClass- A class that members should not be declared in- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beDeclaredIn
@PublicAPI(usage=ACCESS) CONJUNCTION beDeclaredIn(java.lang.String className)
Asserts that members are declared within a class of the supplied class name.
E.g.
would be violated bymembers().should().beDeclaredIn(Example.class.getName())someFieldinclass AnyOther { Object someField; }- Parameters:
className- Fully qualified name of a class that members should be declared in- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeDeclaredIn
@PublicAPI(usage=ACCESS) CONJUNCTION notBeDeclaredIn(java.lang.String className)
Asserts that members are not declared within a class of the supplied class name.
E.g.
would be violated bymembers().should().notBeDeclaredIn(Example.class.getName())someFieldinclass Example { Object someField; }- Parameters:
className- Fully qualified name of a class that members must not be declared in to match- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beDeclaredInClassesThat
@PublicAPI(usage=ACCESS) CONJUNCTION beDeclaredInClassesThat(DescribedPredicate<? super JavaClass> predicate)
Asserts that members are declared within a class matching the supplied predicate.
E.g.
would be violated bymembers().should().beDeclaredInClassesThat(areSubTypeOf(Example.class))someFieldinclass AnyOther { Object someField; }- Parameters:
predicate- A predicate which matches classes where members have to be declared in- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beDeclaredInClassesThat
@PublicAPI(usage=ACCESS) ClassesThat<CONJUNCTION> beDeclaredInClassesThat()
Allows to assert that members are declared within a certain class.
E.g.
would be violated bymembers().should().beDeclaredInClassesThat().areAssignableTo(Example.class)someFieldinclass AnyOther { Object someField; }- Returns:
- A syntax element that allows restricting where members are declared in
-
-