Interface IntBoolFunction<R>

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface IntBoolFunction<R>
    IntBoolFunction Documentation.

    This is a function having an 'apply(...)' method which accepts two primitives-type parameters as follows type:

    1. 'int'
    2. 'boolean'


    The output of apply(...) follows the standard rules of Java's functional interfaces, and may be specified using the generic-type parameter 'R'.



    • Method Detail

      • apply

        R apply​(int i,
                boolean b)
        Applies this function to the given arguments.
        Parameters:
        i - The integer (first) argument to the function.
        b - The boolean (second) argument to the function.
        Returns:
        The function result.
      • andThen

        default <V> IntBoolFunction<V> andThen​
                    (java.util.function.Function<R,​V> after)
        
        Returns a composed function that first applies 'this' function to its input, and then applies the 'after' function to the result. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.
        Type Parameters:
        V - The output-type of the 'after' function, and also of the (returned) 'composed' function.
        Parameters:
        after - The function to apply, after this function is applied.
        Throws:
        java.lang.NullPointerException - This throws if null is passed to 'after'.
        Code:
        Exact Method Body:
        1
        2
        3
        4
         if (after == null) throw new NullPointerException
             ("null has been passed to parameter 'after'");
        
         return (int i, boolean b) -> after.apply(this.apply(i, b));