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 ClassesNested 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 totrueallows the should-clause of this rule to be checked against an empty set of elements.Allows to adjust the description of this object.voidcheck(JavaClasses classes) evaluate(JavaClasses classes) static CompositeArchRulestatic CompositeArchRulestatic CompositeArchRule.Creator
-
Method Details
-
of
-
of
-
priority
-
and
-
check
-
because
-
allowEmptyShould
Description copied from interface:ArchRuleIf set totrueallows 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:
allowEmptyShouldin interfaceArchRule- Parameters:
allowEmptyShould- Whether the rule fails if the should-clause is evaluated with an empty set of elements- Returns:
- A (new)
ArchRulewith adjustedallowEmptyShouldbehavior
-
evaluate
- Specified by:
evaluatein interfaceCanBeEvaluated
-
as
Description copied from interface:CanOverrideDescriptionAllows 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:
asin interfaceCanOverrideDescription<ArchRule>- Parameters:
newDescription- The description the result of this method will hold- Returns:
- A new equivalent object with adjusted description
-
getDescription
- Specified by:
getDescriptionin interfaceHasDescription
-