001package Torello.Java.Function;
002
003/**
004 * Function-Pointer
005 * <SPAN CLASS=TJF>Input:</SPAN> {@code A, B, C, D, E}
006 * <SPAN CLASS=TJF>Output:</SPAN> {@code void}.
007 * 
008 * <BR /><BR />
009 * <EMBED CLASS='external-html' DATA-FILE-ID=BIG_CONSUMER>
010 * <EMBED CLASS="globalDefs" DATA-Name='Quint Consumer' DATA-Number=five>
011 * 
012 * @param <A> The type of the first input-parameter.
013 * @param <B> The type of the second input-parameter.
014 * @param <C> The type of the third input-parameter.
015 * @param <D> The type of the fourth input-parameter.
016 * @param <E> The type of the last input-parameter.
017 */
018@FunctionalInterface
019public interface QuintConsumer<A, B, C, D, E>
020{
021    /**
022     * Performs {@code 'this'} operation on the given arguments.
023     * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH>
024     *
025     * @param a the first input argument
026     * @param b the second input argument
027     * @param c the third input argument
028     * @param d the fourth input argument
029     * @param e the fifth input argument
030     */
031    public void accept(A a, B b, C c, D d, E e);
032
033    /**
034     * <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_METHOD>
035     * @param after <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_AFTER>
036     * @return <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_RETURN>
037     * @throws NullPointerException if parameter {@code 'other'} is null.
038     */
039    default QuintConsumer<A, B, C, D, E> andThen
040        (QuintConsumer<? super A, ? super B, ? super C, ? super D, ? super E> after)
041    {
042        if (after == null)
043            throw new NullPointerException("null has been passed to parameter 'after'");
044
045        return (A a, B b, C c, D d, E e) ->
046        {
047            this.accept(a, b, c, d, e);
048            after.accept(a, b, c, d, e);
049        };
050    }
051 
052}