Interface FieldsShould<CONJUNCTION extends FieldsShouldConjunction>
-
- All Superinterfaces:
MembersShould<CONJUNCTION>
public interface FieldsShould<CONJUNCTION extends FieldsShouldConjunction> extends MembersShould<CONJUNCTION>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CONJUNCTION
beFinal()
Asserts that fields are final.CONJUNCTION
beStatic()
Asserts that fields are static.CONJUNCTION
haveRawType(DescribedPredicate<? super JavaClass> predicate)
Asserts that fields have a raw type matching the given predicate.CONJUNCTION
haveRawType(java.lang.Class<?> type)
Asserts that fields have a certain raw type.CONJUNCTION
haveRawType(java.lang.String typeName)
Asserts that fields have a certain fully qualified name of their raw type.CONJUNCTION
notBeFinal()
Asserts that fields are non-final.CONJUNCTION
notBeStatic()
Asserts that fields are non-static.CONJUNCTION
notHaveRawType(DescribedPredicate<? super JavaClass> predicate)
Asserts that fields do not have a raw type matching the given predicate.CONJUNCTION
notHaveRawType(java.lang.Class<?> type)
Asserts that fields do not have a certain raw type.CONJUNCTION
notHaveRawType(java.lang.String typeName)
Asserts that fields do not have a certain fully qualified name of their raw type.-
Methods inherited from interface com.tngtech.archunit.lang.syntax.elements.MembersShould
beAnnotatedWith, beAnnotatedWith, beAnnotatedWith, beDeclaredIn, beDeclaredIn, beDeclaredInClassesThat, beDeclaredInClassesThat, beMetaAnnotatedWith, beMetaAnnotatedWith, beMetaAnnotatedWith, bePackagePrivate, bePrivate, beProtected, bePublic, haveFullName, haveFullNameMatching, haveFullNameNotMatching, haveModifier, haveName, haveNameMatching, haveNameNotMatching, notBeAnnotatedWith, notBeAnnotatedWith, notBeAnnotatedWith, notBeDeclaredIn, notBeDeclaredIn, notBeMetaAnnotatedWith, notBeMetaAnnotatedWith, notBeMetaAnnotatedWith, notBePackagePrivate, notBePrivate, notBeProtected, notBePublic, notHaveFullName, notHaveModifier, notHaveName
-
-
-
-
Method Detail
-
haveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(java.lang.Class<?> type)
Asserts that fields have a certain raw type.
E.g.
would be violated byfields()
.should()
.haveRawType(String.class)
someField
inclass Example { Object someField; }
- Parameters:
type
- Type fields should have- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notHaveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION notHaveRawType(java.lang.Class<?> type)
Asserts that fields do not have a certain raw type.
E.g.
would be violated byfields()
.should()
.notHaveRawType(String.class)
someField
inclass Example { String someField; }
- Parameters:
type
- Type fields should not have- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
haveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(java.lang.String typeName)
Asserts that fields have a certain fully qualified name of their raw type.
E.g.
would be violated byfields()
.should()
.haveRawType(String.class.getName())
someField
inclass Example { Object someField; }
- Parameters:
typeName
- Name of type fields should have- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notHaveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION notHaveRawType(java.lang.String typeName)
Asserts that fields do not have a certain fully qualified name of their raw type.
E.g.
would be violated byfields()
.should()
.notHaveRawType(String.class.getName())
someField
inclass Example { String someField; }
- Parameters:
typeName
- Name of type fields should not have- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
haveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(DescribedPredicate<? super JavaClass> predicate)
Asserts that fields have a raw type matching the given predicate.
E.g.
would be violated byfields()
.should()
.haveRawType(assignableTo(Serializable.class))
someField
inclass Example { Object someField; }
- Parameters:
predicate
- A predicate determining which sort of types fields should have- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notHaveRawType
@PublicAPI(usage=ACCESS) CONJUNCTION notHaveRawType(DescribedPredicate<? super JavaClass> predicate)
Asserts that fields do not have a raw type matching the given predicate.
E.g.
would be violated byfields()
.should()
.notHaveRawType(assignableTo(Serializable.class))
someField
inclass Example { String someField; }
- Parameters:
predicate
- A predicate determining which sort of types fields should not have- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beStatic
@PublicAPI(usage=ACCESS) CONJUNCTION beStatic()
Asserts that fields are static.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeStatic
@PublicAPI(usage=ACCESS) CONJUNCTION notBeStatic()
Asserts that fields are non-static.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
beFinal
@PublicAPI(usage=ACCESS) CONJUNCTION beFinal()
Asserts that fields are final.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
notBeFinal
@PublicAPI(usage=ACCESS) CONJUNCTION notBeFinal()
Asserts that fields are non-final.- Returns:
- A syntax element that can either be used as working rule, or to continue specifying a more complex rule
-
-