Interface ThrowingBiConsumer<A,​B,​X extends Exception>

  • Type Parameters:
    A - the type of the first argument to the operation
    B - the type of the second argument to the operation
    X - the type of the exception that might be thrown
    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 ThrowingBiConsumer<A,​B,​X extends Exception>
    Represents an operation that accepts two input arguments and returns no result. This is the two-arity specialization of Consumer. Unlike most other functional interfaces, BiConsumer is expected to operate via side-effects.
    • Method Detail

      • accept

        void accept​(A t,
                    B u)
             throws X extends Exception
        Performs this operation on the given arguments.
        Parameters:
        t - the first input argument
        u - the second input argument
        Throws:
        X - if the operation fails
        X extends Exception
      • andThen

        default ThrowingBiConsumer<A,​B,​X> andThen​(ThrowingBiConsumer<? super A,​? super B,​? extends X> after)
        Returns a composed BiConsumer that performs, in sequence, this operation followed by the after operation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, the after operation will not be performed.
        Parameters:
        after - the operation to perform after this operation
        Returns:
        a composed BiConsumer that performs in sequence this operation followed by the after operation
        Throws:
        NullPointerException - if after is null
      • curryFirst

        default ThrowingConsumer<B,​X> curryFirst​(A t)
        Get a ThrowingConsumer by currying the first parameter.
        Parameters:
        t - the constant parameter
        Returns:
        the consumer
      • currySecond

        default ThrowingConsumer<A,​X> currySecond​(B u)
        Get ThrowingConsumer by currying the second parameter.
        Parameters:
        u - the constant parameter
        Returns:
        the consumer
      • mapFirst

        default <T> ThrowingBiConsumer<T,​B,​X> mapFirst​(ThrowingFunction<? super T,​? extends A,​X> fun)
        Change the first parameter using the supplied mapper.
        Type Parameters:
        T - the new type of the first parameter
        Parameters:
        fun - the mapper
        Returns:
        the consumer
      • mapSecond

        default <T> ThrowingBiConsumer<A,​T,​X> mapSecond​(ThrowingFunction<? super T,​? extends B,​X> fun)
        Change the second parameter using the supplied mapper.
        Type Parameters:
        T - the new type of the second parameter
        Parameters:
        fun - the mapper
        Returns:
        the consumer