001package Torello.Java.Function;
002
003/**
004 * <CODE>TriConsumer Documentation.</CODE><BR /><BR />
005 * <EMBED CLASS="external-html" DATA-FILE-ID=BIGCONS>
006 * <EMBED CLASS="globalDefs" DATA-Name='Tri Consumer' DATA-Number=three>
007 * @param <A> The type of the first input-parameter.
008 * @param <B> The type of the second input-parameter.
009 * @param <C> The type of the last input-parameter.
010 */
011@FunctionalInterface
012public interface TriConsumer<A, B, C>
013{
014    /**
015     * Performs {@code 'this'} operation on the given arguments.
016     * @param a the first input argument
017     * @param b the second input argument
018     * @param c the third input argument
019     */
020    public void accept(A a, B b, C c);
021
022    /**
023     * <EMBED CLASS="external-html" DATA-FILE-ID="CONTHENMETH">
024     * @param after <EMBED CLASS="external-html" DATA-FILE-ID="CONTHENAFT">
025     * @return <EMBED CLASS="external-html" DATA-FILE-ID="CONTHENRET">
026     * @throws NullPointerException if parameter {@code 'other'} is null.
027     */
028    default TriConsumer<A, B, C> andThen(TriConsumer<? super A, ? super B, ? super C> after)
029    {
030        if (after == null)
031            throw new NullPointerException("null has been passed to parameter 'after'");
032
033        return (A a, B b, C c) ->
034        {
035            this.accept(a, b, c);
036            after.accept(a, b, c);
037        };
038    }
039 
040}