Interface ClassesShouldConjunction

All Superinterfaces:
ArchRule, CanBeEvaluated, CanOverrideDescription<ArchRule>, HasDescription

@PublicAPI(usage=ACCESS) public interface ClassesShouldConjunction extends ArchRule
Allows to join together any existing ArchCondition of this rule with another ArchCondition via and or or. Note that the behavior is always fully left-associative, i.e. there is no "operator precedence" as for && or ||. Take for example

 classes()...should().bePublic().orShould().bePrivate().andShould().haveNameMatching(pattern)
 
The semantics of the new condition will be (public OR private) AND haveNameMatching – and not public || (private && haveNameMatching).

Thus, for more complex conditions please consider explicitly joining preconfigured conditions or custom conditions via ArchCondition.and(ArchCondition) and ArchCondition.or(ArchCondition) where you can freely control the precedence via nesting. E.g.

 classes()...should(
   bePublic().or(
     bePrivate().and(haveNameMatching(pattern))
   )
 )
 
Note that inverting the rule, e.g. via ArchRuleDefinition.noClasses(), will also invert the join operator. I.e. if you define noClasses().should().a().orShould().b() it will mean that all classes must satisfy not(a) AND not(b).