Class IntPredicateLambda

  • All Implemented Interfaces:
    java.util.function.IntPredicate, IntPredicateProxy

    public class IntPredicateLambda
    extends java.lang.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 Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static IntPredicateProxy of​(java.util.function.IntPredicate lambda)
      Implement an integer predicate as a lambda expression
      boolean test​(int value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.IntPredicate

        and, negate, or
    • Method Detail

      • of

        public static IntPredicateProxy of​(java.util.function.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
      • test

        public boolean test​(int value)
        Specified by:
        test in interface java.util.function.IntPredicate
        Specified by:
        test in interface IntPredicateProxy