Class SliceRule
java.lang.Object
com.tngtech.archunit.library.dependencies.SliceRule
- All Implemented Interfaces:
HasDescription
,CanOverrideDescription<ArchRule>
,ArchRule
,CanBeEvaluated
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tngtech.archunit.lang.ArchRule
ArchRule.Assertions, ArchRule.Factory, ArchRule.Transformation
-
Method Summary
Modifier and TypeMethodDescriptionallowEmptyShould
(boolean allowEmptyShould) If set totrue
allows the should-clause of this rule to be checked against an empty set of elements.Allows to adjust the description of this object.void
check
(JavaClasses classes) evaluate
(JavaClasses classes) ignoreDependency
(DescribedPredicate<? super JavaClass> origin, DescribedPredicate<? super JavaClass> target) ignoreDependency
(Class<?> origin, Class<?> target) ignoreDependency
(String origin, String target) toString()
-
Method Details
-
check
-
because
-
allowEmptyShould
Description copied from interface:ArchRule
If set totrue
allows the should-clause of this rule to be checked against an empty set of elements. Otherwise, the rule will fail with a respective message. This is to prevent possible implementation errors, like filtering for a non-existing package in the that-clause causing an always-passing rule.
Note that this method will override the configuration propertyarchRule.failOnEmptyShould
.- Specified by:
allowEmptyShould
in interfaceArchRule
- Parameters:
allowEmptyShould
- Whether the rule fails if the should-clause is evaluated with an empty set of elements- Returns:
- A (new)
ArchRule
with adjustedallowEmptyShould
behavior
-
evaluate
- Specified by:
evaluate
in interfaceCanBeEvaluated
-
getDescription
- Specified by:
getDescription
in interfaceHasDescription
-
as
Description copied from interface:CanOverrideDescription
Allows to adjust the description of this object. Note that this method will not modify the current object, but instead return a new object with adjusted description.- Specified by:
as
in interfaceCanOverrideDescription<ArchRule>
- Parameters:
newDescription
- The description the result of this method will hold- Returns:
- A new equivalent object with adjusted description
-
ignoreDependency
-
ignoreDependency
-
ignoreDependency
@PublicAPI(usage=ACCESS) public SliceRule ignoreDependency(DescribedPredicate<? super JavaClass> origin, DescribedPredicate<? super JavaClass> target) -
toString
-