Class Having<Original,​Derived>

  • All Implemented Interfaces:
    Predicate<Original>

    public final class Having<Original,​Derived>
    extends java.lang.Object
    implements Predicate<Original>
    A Predicate which delegates the test to another Predicate testing a value derived from the original testee.

    Example: Filter any Strings which are not 5 characters long.

    
     new Sieved<>(new Having<>(String::length, new Equals<>(5)), strings);