Class IntPredicateLambda

  • All Implemented Interfaces:
    IntPredicate, IntPredicateProxy

    public class IntPredicateLambda
    extends Object
    implements IntPredicateProxy
    This class allows an integer predicate (a boolean function of an integer) to be written as a lambda expression, in a way that works both in Java and C#. It is needed because interfaces and delegates are interchangeable in Java (through the mechanism of "functional interfaces"), but the same is not the case in C#.
    • Method Detail

      • of

        public static IntPredicateProxy of​(IntPredicate lambda)
        Implement an integer predicate as a lambda expression
        Parameters:
        lambda - an implementation of the functional interface IntPredicate, generally supplied as a lambda expression (for example i -> i > 0 for a predicate that matches all positive integers).
        Returns:
        the integer predicate