Interface GivenSlicesConjunction

    • Method Detail

      • and

        GivenSlicesConjunction and​(DescribedPredicate<? super Slice> 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) and GivenConjunction.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 interface GivenConjunction<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