Interface FieldsThat<CONJUNCTION extends GivenFieldsConjunction>
-
- All Superinterfaces:
MembersThat<CONJUNCTION>
public interface FieldsThat<CONJUNCTION extends GivenFieldsConjunction> extends MembersThat<CONJUNCTION>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CONJUNCTION
areFinal()
Matches final fields.CONJUNCTION
areNotFinal()
Matches non-final fields.CONJUNCTION
areNotStatic()
Matches non-static fields.CONJUNCTION
areStatic()
Matches static fields.CONJUNCTION
doNotHaveRawType(DescribedPredicate<? super JavaClass> predicate)
Matches fields where the raw type of those fields does not match the given predicate.CONJUNCTION
doNotHaveRawType(java.lang.Class<?> type)
Matches fields that do not have the given raw type.CONJUNCTION
doNotHaveRawType(java.lang.String typeName)
Matches fields that do not have the given fully qualified name of their raw type.CONJUNCTION
haveRawType(DescribedPredicate<? super JavaClass> predicate)
Matches fields where the raw type of those fields matches the given predicate.CONJUNCTION
haveRawType(java.lang.Class<?> type)
Matches fields by their raw type.CONJUNCTION
haveRawType(java.lang.String typeName)
Matches fields by the fully qualified name of their raw type.-
Methods inherited from interface com.tngtech.archunit.lang.syntax.elements.MembersThat
areAnnotatedWith, areAnnotatedWith, areAnnotatedWith, areDeclaredIn, areDeclaredIn, areDeclaredInClassesThat, areDeclaredInClassesThat, areMetaAnnotatedWith, areMetaAnnotatedWith, areMetaAnnotatedWith, areNotAnnotatedWith, areNotAnnotatedWith, areNotAnnotatedWith, areNotDeclaredIn, areNotDeclaredIn, areNotMetaAnnotatedWith, areNotMetaAnnotatedWith, areNotMetaAnnotatedWith, areNotPackagePrivate, areNotPrivate, areNotProtected, areNotPublic, arePackagePrivate, arePrivate, areProtected, arePublic, doNotHaveFullName, doNotHaveModifier, doNotHaveName, haveFullName, haveFullNameMatching, haveFullNameNotMatching, haveModifier, haveName, haveNameMatching, haveNameNotMatching
-
-
-
-
Method Detail
-
haveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(java.lang.Class<?> type)
Matches fields by their raw type. Take for example
Thenclass Example { String someField; }
someField
would be matched byfields()
.that()
.haveRawType(String.class)
- Parameters:
type
- Type matching fields must have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveRawType(java.lang.Class<?> type)
Matches fields that do not have the given raw type. Take for example
Thenclass Example { String someField; }
someField
would be matched byfields()
.that()
.doNotHaveRawType(Object.class)
- Parameters:
type
- Type matching fields must not have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(java.lang.String typeName)
Matches fields by the fully qualified name of their raw type. Take for example
Thenclass Example { String someField; }
someField
would be matched byfields()
.that()
.haveRawType(String.class.getName())
- Parameters:
typeName
- Name of type matching fields must have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveRawType(java.lang.String typeName)
Matches fields that do not have the given fully qualified name of their raw type. Take for example
Thenclass Example { String someField; }
someField
would be matched byfields()
.that()
.doNotHaveRawType(Object.class.getName())
- Parameters:
typeName
- Name of type matching fields must not have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(DescribedPredicate<? super JavaClass> predicate)
Matches fields where the raw type of those fields matches the given predicate. Take for example
Thenclass Example { String someField; }
someField
would be matched byfields()
.that()
.haveRawType(assignableTo(Serializable.class))
- Parameters:
predicate
- A predicate determining which types of fields match- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveRawType(DescribedPredicate<? super JavaClass> predicate)
Matches fields where the raw type of those fields does not match the given predicate. Take for example
Thenclass Example { String someField; }
someField
would be matched byfields()
.that()
.doNotHaveRawType(assignableTo(List.class))
- Parameters:
predicate
- A predicate determining which types of fields do not match- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areStatic
@PublicAPI(usage=ACCESS) CONJUNCTION areStatic()
Matches static fields.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotStatic
@PublicAPI(usage=ACCESS) CONJUNCTION areNotStatic()
Matches non-static fields.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areFinal
@PublicAPI(usage=ACCESS) CONJUNCTION areFinal()
Matches final fields.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotFinal
@PublicAPI(usage=ACCESS) CONJUNCTION areNotFinal()
Matches non-final fields.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
-