Interface GivenClassesConjunction
- All Superinterfaces:
GivenConjunction<JavaClass>
@PublicAPI(usage=ACCESS)
public interface GivenClassesConjunction
extends GivenConjunction<JavaClass>
-
Method Summary
Modifier and TypeMethodDescriptionand()
and
(DescribedPredicate<? super JavaClass> predicate) Combines the current predicate (e.g.or()
or
(DescribedPredicate<? super JavaClass> predicate) Combines the current predicate (e.g.should()
should
(ArchCondition<? super JavaClass> condition)
-
Method Details
-
should
@PublicAPI(usage=ACCESS) ClassesShouldConjunction should(ArchCondition<? super JavaClass> condition) Description copied from interface:GivenConjunction
- Specified by:
should
in interfaceGivenConjunction<JavaClass>
- Parameters:
condition
- TheArchCondition
to check objects against- Returns:
- An
ArchRule
that can be checked against a set ofOBJECTS
-
should
-
and
@PublicAPI(usage=ACCESS) GivenClassesConjunction and(DescribedPredicate<? super JavaClass> predicate) Description copied from interface:GivenConjunction
Combines the current predicate (e.g.simpleName
== 'SomeClass') with another predicate (e.g.resideInAPackage
'foo.bar') using AND (i.e. both predicates must be satisfied).
NOTE:
GivenConjunction.and(DescribedPredicate)
andGivenConjunction.or(DescribedPredicate)
combine predicates in the sequence they are declared, without any "operator precedence". I.e.
all(objects()).that(predicateA).or(predicateB).and(predicateC)...
will filter on predicate
(predicateA || predicateB) && predicateC
, and
all(objects()).that(predicateA).and(predicateB).or(predicateC)...
will filter on predicate
(predicateA && predicateB) || predicateC
. If you need more control over the precedence, how predicates are joined, you have to join these predicates separately, i.e.
all(objects()).that(predicateA.or(predicateB.and(predicateC)))...
- Specified by:
and
in interfaceGivenConjunction<JavaClass>
- Parameters:
predicate
- The predicate to be ANDed on the current object filter predicate- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
and
- See Also:
-
or
@PublicAPI(usage=ACCESS) GivenClassesConjunction or(DescribedPredicate<? super JavaClass> predicate) Description copied from interface:GivenConjunction
Combines the current predicate (e.g.simpleName
== 'SomeClass') with another predicate (e.g.resideInAPackage
'foo.bar') using OR (i.e. at least one of the predicates must be satisfied).
NOTE: For considerations about precedence, when joining predicates, consider note at
GivenConjunction.and(DescribedPredicate)
- Specified by:
or
in interfaceGivenConjunction<JavaClass>
- Parameters:
predicate
- The predicate to be ORed on the current object filter predicate- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
or
- See Also:
-