Interface CodeUnitsThat<CONJUNCTION extends GivenCodeUnitsConjunction<?>>
- All Superinterfaces:
MembersThat<CONJUNCTION>
- All Known Subinterfaces:
MethodsThat<CONJUNCTION>
public interface CodeUnitsThat<CONJUNCTION extends GivenCodeUnitsConjunction<?>>
extends MembersThat<CONJUNCTION>
-
Method Summary
Modifier and TypeMethodDescriptiondeclareThrowableOfType
(DescribedPredicate<? super JavaClass> predicate) MatchesJavaCodeUnits
that declare aThrowable
which matches the given predicate.declareThrowableOfType
(Class<? extends Throwable> type) MatchesJavaCodeUnits
that declare aThrowable
of the specified type in their throws clause.declareThrowableOfType
(String typeName) MatchesJavaCodeUnits
that declare aThrowable
of the specified fully qualified type name in their throws clause.doNotDeclareThrowableOfType
(DescribedPredicate<? super JavaClass> predicate) MatchesJavaCodeUnits
that do not declare aThrowable
which matches the given predicate.doNotDeclareThrowableOfType
(Class<? extends Throwable> type) MatchesJavaCodeUnits
that do not declare aThrowable
of the specified type in their throws clause.doNotDeclareThrowableOfType
(String typeName) MatchesJavaCodeUnits
that do not declare aThrowable
of the specified fully qualified type name in their throws clause.doNotHaveRawParameterTypes
(DescribedPredicate<? super List<JavaClass>> predicate) MatchesJavaCodeUnits
that do not have raw parameter types matching the given predicate.doNotHaveRawParameterTypes
(Class<?>... parameterTypes) MatchesJavaCodeUnits
that do not have the specified raw parameter types.doNotHaveRawParameterTypes
(String... parameterTypeNames) MatchesJavaCodeUnits
that do not have the specified fully qualified raw parameter type names.doNotHaveRawReturnType
(DescribedPredicate<? super JavaClass> predicate) MatchesJavaCodeUnits
that do not have raw return types matching the given predicate.doNotHaveRawReturnType
(Class<?> type) MatchesJavaCodeUnits
that do not have the specified raw return types.doNotHaveRawReturnType
(String typeName) MatchesJavaCodeUnits
that do not have the specified fully qualified raw return type name.haveRawParameterTypes
(DescribedPredicate<? super List<JavaClass>> predicate) MatchesJavaCodeUnits
that have raw parameter types matching the given predicate.haveRawParameterTypes
(Class<?>... parameterTypes) MatchesJavaCodeUnits
that have the specified raw parameter types.haveRawParameterTypes
(String... parameterTypeNames) MatchesJavaCodeUnits
that have the specified fully qualified raw parameter type names.haveRawReturnType
(DescribedPredicate<? super JavaClass> predicate) MatchesJavaCodeUnits
that have raw return types matching the given predicate.haveRawReturnType
(Class<?> type) MatchesJavaCodeUnits
that have the specified raw return types.haveRawReturnType
(String typeName) MatchesJavaCodeUnits
that have the specified fully qualified raw return type name.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, haveNameContaining, haveNameEndingWith, haveNameMatching, haveNameNotContaining, haveNameNotEndingWith, haveNameNotMatching, haveNameNotStartingWith, haveNameStartingWith
-
Method Details
-
haveRawParameterTypes
MatchesJavaCodeUnits
that have the specified raw parameter types. Take for example
Thenclass Example { void someMethod(String stringParam, int intParam) {...} }
someMethod
would be matched bycodeUnits()
.that()
.haveRawParameterTypes(String.class, int.class)
- Parameters:
parameterTypes
- Parameter types to matchJavaCodeUnits
against- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawParameterTypes
MatchesJavaCodeUnits
that do not have the specified raw parameter types. Take for example
Thenclass Example { void someMethod(String stringParam, int intParam) {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotHaveRawParameterTypes(String.class)
- Parameters:
parameterTypes
- Parameter types matchingJavaCodeUnits
may not have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveRawParameterTypes
MatchesJavaCodeUnits
that have the specified fully qualified raw parameter type names. Take for example
Thenclass Example { void someMethod(String stringParam, int intParam) {...} }
someMethod
would be matched bycodeUnits()
.that()
.haveRawParameterTypes(String.class.getName(), int.class.getName())
- Parameters:
parameterTypeNames
- Fully qualified names of parameter types to matchJavaCodeUnits
against- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawParameterTypes
MatchesJavaCodeUnits
that do not have the specified fully qualified raw parameter type names. Take for example
Thenclass Example { void someMethod(String stringParam, int intParam) {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotHaveRawParameterTypes(String.class.getName())
- Parameters:
parameterTypeNames
- Fully qualified names of parameter types matchingJavaCodeUnits
may not have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveRawParameterTypes
@PublicAPI(usage=ACCESS) CONJUNCTION haveRawParameterTypes(DescribedPredicate<? super List<JavaClass>> predicate) MatchesJavaCodeUnits
that have raw parameter types matching the given predicate. Take for example
Thenclass Example { void someMethod(String stringParam, int intParam) {...} }
someMethod
would be matched bycodeUnits()
.that()
.haveRawParameterTypes(whereFirstTypeIs(String.class))
- Parameters:
predicate
- ADescribedPredicate
that determines, whichJavaCodeUnits
match by their raw parameter types- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawParameterTypes
@PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveRawParameterTypes(DescribedPredicate<? super List<JavaClass>> predicate) MatchesJavaCodeUnits
that do not have raw parameter types matching the given predicate. Take for example
Thenclass Example { void someMethod(String stringParam, int intParam) {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotHaveRawParameterTypes(whereFirstTypeIs(int.class))
- Parameters:
predicate
- ADescribedPredicate
that determines, whichJavaCodeUnits
do not match by their raw parameter types- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveRawReturnType
MatchesJavaCodeUnits
that have the specified raw return types. Take for example
Thenclass Example { String someMethod() {...} }
someMethod
would be matched bycodeUnits()
.that()
.haveRawReturnType(String.class)
- Parameters:
type
- Return type to matchJavaCodeUnits
against- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawReturnType
MatchesJavaCodeUnits
that do not have the specified raw return types. Take for example
Thenclass Example { String someMethod() {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotHaveRawReturnType(Object.class)
- Parameters:
type
- Return type matchingJavaCodeUnits
may not have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveRawReturnType
MatchesJavaCodeUnits
that have the specified fully qualified raw return type name. Take for example
Thenclass Example { String someMethod() {...} }
someMethod
would be matched bycodeUnits()
.that()
.haveRawReturnType(String.class.getName())
- Parameters:
typeName
- Fully qualified name of a return type to matchJavaCodeUnits
against- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawReturnType
MatchesJavaCodeUnits
that do not have the specified fully qualified raw return type name. Take for example
Thenclass Example { String someMethod() {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotHaveRawReturnType(Object.class.getName())
- Parameters:
typeName
- Fully qualified name of a return type matchingJavaCodeUnits
may not have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveRawReturnType
@PublicAPI(usage=ACCESS) CONJUNCTION haveRawReturnType(DescribedPredicate<? super JavaClass> predicate) MatchesJavaCodeUnits
that have raw return types matching the given predicate. Take for example
Thenclass Example { String someMethod() {...} }
someMethod
would be matched bycodeUnits()
.that()
.haveRawReturnType(assignableTo(Serializable.class))
- Parameters:
predicate
- ADescribedPredicate
that determines, whichJavaCodeUnits
match by their raw return types- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveRawReturnType
@PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveRawReturnType(DescribedPredicate<? super JavaClass> predicate) MatchesJavaCodeUnits
that do not have raw return types matching the given predicate. Take for example
Thenclass Example { String someMethod() {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotHaveRawReturnType(assignableTo(List.class))
- Parameters:
predicate
- ADescribedPredicate
that determines, whichJavaCodeUnits
do not match by their raw return types- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
declareThrowableOfType
MatchesJavaCodeUnits
that declare aThrowable
of the specified type in their throws clause. Take for example
Thenclass Example { void someMethod() throws FirstException, SecondException {...} }
someMethod
would be matched bycodeUnits()
.that()
.declareThrowableOfType(FirstException.class)
- Parameters:
type
- Type of a declaredThrowable
to matchJavaCodeUnits
against- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotDeclareThrowableOfType
MatchesJavaCodeUnits
that do not declare aThrowable
of the specified type in their throws clause. Take for example
Thenclass Example { void someMethod() throws FirstException {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotDeclareThrowableOfType(SecondException.class)
- Parameters:
type
- Type of a declaredThrowable
matchingJavaCodeUnits
may not have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
declareThrowableOfType
MatchesJavaCodeUnits
that declare aThrowable
of the specified fully qualified type name in their throws clause. Take for example
Thenclass Example { void someMethod() throws FirstException, SecondException {...} }
someMethod
would be matched bycodeUnits()
.that()
.declareThrowableOfType(FirstException.class.getName())
- Parameters:
typeName
- Fully qualified name of a type of a declaredThrowable
to matchJavaCodeUnits
against- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotDeclareThrowableOfType
MatchesJavaCodeUnits
that do not declare aThrowable
of the specified fully qualified type name in their throws clause. Take for example
Thenclass Example { void someMethod() throws FirstException {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotDeclareThrowableOfType(SecondException.class.getName())
- Parameters:
typeName
- Fully qualified name of a type of a declaredThrowable
matchingJavaCodeUnits
may not have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
declareThrowableOfType
@PublicAPI(usage=ACCESS) CONJUNCTION declareThrowableOfType(DescribedPredicate<? super JavaClass> predicate) MatchesJavaCodeUnits
that declare aThrowable
which matches the given predicate. Take for example
Thenclass Example { void someMethod() throws FirstException, SecondException {...} }
someMethod
would be matched bycodeUnits()
.that()
.declareThrowableOfType(nameStartingWith("First"))
- Parameters:
predicate
- ADescribedPredicate
that determines, whichJavaCodeUnits
match by their declaredThrowable
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotDeclareThrowableOfType
@PublicAPI(usage=ACCESS) CONJUNCTION doNotDeclareThrowableOfType(DescribedPredicate<? super JavaClass> predicate) MatchesJavaCodeUnits
that do not declare aThrowable
which matches the given predicate. Take for example
Thenclass Example { void someMethod() throws FirstException {...} }
someMethod
would be matched bycodeUnits()
.that()
.doNotDeclareThrowableOfType(nameStartingWith("Second"))
- Parameters:
predicate
- ADescribedPredicate
that determines, whichJavaCodeUnits
do not match by their declaredThrowable
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-