com.sta.mutils.TriConsumer Maven / Gradle / Ivy
package com.sta.mutils;
import java.util.Objects;
/**
* Name: TriConsumer
* Description: Erweiterung von BiConsumer.
* @param the type of the first argument to the operation
* @param the type of the second argument to the operation
* @param the type of the third argument to the operation
*
* Comment: ...
*
* Copyright: Copyright (c) 2020
* Company: >StA-Soft<
* @author StA
* @version 1.0
*/
@FunctionalInterface
public interface TriConsumer
{
/**
* Performs this operation on the given arguments.
* @param t0 the first input argument
* @param t1 the second input argument
* @param t2 the third input argument
*/
void accept(T0 t0, T1 t1, T2 t2);
/**
* Returns a composed {@code TriConsumer} that performs, in sequence, this
* operation followed by the {@code 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 {@code after} operation will not be performed.
* @param after the operation to perform after this operation
* @return a composed {@code TriConsumer} that performs in sequence this operation followed by the {@code after} operation
* @throws NullPointerException if {@code after} is null
*/
default TriConsumer andThen(TriConsumer super T0, ? super T1, ? super T2> after)
{
Objects.requireNonNull(after);
return (t0, t1, t2) ->
{
accept(t0, t1, t2);
after.accept(t0, t1, t2);
};
}
}