Interface GivenMembersConjunction<MEMBER extends JavaMember>
- All Superinterfaces:
GivenConjunction<MEMBER>
- All Known Subinterfaces:
GivenCodeUnitsConjunction<CODE_UNIT>,GivenConstructorsConjunction,GivenFieldsConjunction,GivenMethodsConjunction
@PublicAPI(usage=ACCESS)
public interface GivenMembersConjunction<MEMBER extends JavaMember>
extends GivenConjunction<MEMBER>
-
Method Summary
Modifier and TypeMethodDescriptionMembersThat<? extends GivenMembersConjunction<MEMBER>>and()Likeand(DescribedPredicate)but allows to pick the predicate to join by a fluent API.and(DescribedPredicate<? super MEMBER> predicate) Combines the current predicate (e.g.MembersThat<? extends GivenMembersConjunction<MEMBER>>or()Likeor(DescribedPredicate)but allows to pick the predicate to join by a fluent API.or(DescribedPredicate<? super MEMBER> predicate) Combines the current predicate (e.g.MembersShould<? extends MembersShouldConjunction<MEMBER>>should()Likeshould(ArchCondition)but allows to pick the condition to join by a fluent API.should(ArchCondition<? super MEMBER> condition)
-
Method Details
-
and
@PublicAPI(usage=ACCESS) GivenMembersConjunction<MEMBER> and(DescribedPredicate<? super MEMBER> predicate) Description copied from interface:GivenConjunctionCombines 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:
andin interfaceGivenConjunction<MEMBER extends JavaMember>- 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
@PublicAPI(usage=ACCESS) GivenMembersConjunction<MEMBER> or(DescribedPredicate<? super MEMBER> predicate) Description copied from interface:GivenConjunctionCombines 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:
orin interfaceGivenConjunction<MEMBER extends JavaMember>- 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
-
and
Likeand(DescribedPredicate)but allows to pick the predicate to join by a fluent API. -
or
Likeor(DescribedPredicate)but allows to pick the predicate to join by a fluent API. -
should
@PublicAPI(usage=ACCESS) MembersShouldConjunction<MEMBER> should(ArchCondition<? super MEMBER> condition) Description copied from interface:GivenConjunction- Specified by:
shouldin interfaceGivenConjunction<MEMBER extends JavaMember>- Parameters:
condition- TheArchConditionto check objects against- Returns:
- An
ArchRulethat can be checked against a set ofOBJECTS
-
should
Likeshould(ArchCondition)but allows to pick the condition to join by a fluent API.
-