Package com.tngtech.archunit.lang
Class CompositeArchRule
java.lang.Object
com.tngtech.archunit.lang.CompositeArchRule
- 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) static CompositeArchRule
static CompositeArchRule
static CompositeArchRule.Creator
-
Method Details
-
of
-
of
-
priority
-
and
-
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
-
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
-
getDescription
- Specified by:
getDescription
in interfaceHasDescription
-