T1 - the type of the first argument to the operationT2 - the type of the second argument to the operation@FunctionalInterface public interface Consumer2<T1,T2> extends AbstractConsumer2<T1,T2,Consumer2<T1,T2>>
ConsumerN.
This is the non-producing specialization of Function2.
This is a functional interface whose functional method is AbstractConsumer2.accept(Object, Object).
ConsumerN,
Function2| Modifier and Type | Method and Description |
|---|---|
default Consumer2<T1,T2> |
andThen(Consumer2<T1,T2> after)
Returns a chained object that performs, in sequence, this operation followed
by the
after operation. |
default Consumer2<T1,T2> |
andThenUnchecked(Consumer2<T1,T2> after)
Returns a chained object that performs, in sequence, this operation followed
by the
after operation. |
static <T1,T2> Consumer2<T1,T2> |
fromVariant(java.util.function.BiConsumer<? super T1,? super T2> consumer)
Creates an instance of this object from its
BiConsumer variant. |
accept, acceptAllUnchecked, andThen, andThenUnchecked, arity, toVariantapplyAllUnchecked, sizedAcceptAllUncheckedstatic <T1,T2> Consumer2<T1,T2> fromVariant(java.util.function.BiConsumer<? super T1,? super T2> consumer)
BiConsumer variant.T1 - the type of the first argument to the operationT2 - the type of the second argument to the operationconsumer - the variant of this objectBiConsumerdefault Consumer2<T1,T2> andThen(Consumer2<T1,T2> after)
ConsumerChainableafter 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.andThen in interface AbstractConsumer2<T1,T2,Consumer2<T1,T2>>andThen in interface AbstractConsumerN<Consumer2<T1,T2>>andThen in interface ConsumerChainable<Consumer2<T1,T2>>andThen in interface ConsumerChainableConsumer<Consumer2<T1,T2>>after - the operation to perform after this operationafter operationdefault Consumer2<T1,T2> andThenUnchecked(Consumer2<T1,T2> after)
ConsumerChainableafter 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. This makes no assumptions on the arguments of this method.andThenUnchecked in interface AbstractConsumer2<T1,T2,Consumer2<T1,T2>>andThenUnchecked in interface AbstractConsumerN<Consumer2<T1,T2>>andThenUnchecked in interface ConsumerChainable<Consumer2<T1,T2>>andThenUnchecked in interface ConsumerChainableConsumer<Consumer2<T1,T2>>after - the operation to perform after this operationafter operation