Interface GivenSlicesConjunction
- All Superinterfaces:
GivenConjunction<Slice>
-
Method Summary
Modifier and TypeMethodDescriptionand
(DescribedPredicate<? super Slice> predicate) Combines the current predicate (e.g.Customizes the description of the slices under test, i.e.or
(DescribedPredicate<? super Slice> predicate) Combines the current predicate (e.g.should()
LikeGivenConjunction.should(ArchCondition)
but allows to pick theArchCondition
by a fluent API.Methods inherited from interface com.tngtech.archunit.lang.syntax.elements.GivenConjunction
should
-
Method Details
-
should
LikeGivenConjunction.should(ArchCondition)
but allows to pick theArchCondition
by a fluent API. -
and
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<Slice>
- 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
-
or
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<Slice>
- 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
-
as
Customizes the description of the slices under test, i.e. the part before the 'should' of theArchRule
. E.g.
yields the rule textslices().matching("..some.pattern.(*)..").as("My specific components").should()...
My specific components should...
- Parameters:
description
- The description of the slices within the slice rule- Returns:
- A syntax element, which can be used to restrict the classes under consideration
or form a complete
ArchRule
-