001package Torello.Java.Function;
002
003/**
004 * Function-Pointer
005 * <SPAN CLASS=TJF>Input:</SPAN> {@code int, boolean}
006 * <SPAN CLASS=TJF>Output:</SPAN> {@code void}.
007 * 
008 * <BR /><BR />
009 * <EMBED CLASS='external-html' DATA-FILE-ID=TWO_PRIMITIVE_CONS>
010 * <EMBED CLASS="globalDefs" DATA-Type1=int DATA-Type2=boolean>
011 */
012@FunctionalInterface
013public interface IntBoolConsumer
014{
015    /**
016     * Performs this operation on the given arguments.
017     * <BR /><BR /><EMBED CLASS='external-html' DATA-FILE-ID=FUNC_INTER_METH>
018     *
019     * @param i The integer (first) input-argument.
020     * @param b The boolean (second) input-argument.
021     */
022    public void accept(int i, boolean b);
023
024    /**
025     * <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_METHOD>
026     * @param after <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_AFTER>
027     * @return <EMBED CLASS='external-html' DATA-FILE-ID=CON_AND_THEN_RETURN>
028     * @throws NullPointerException if parameter {@code 'other'} is null.
029     */
030    default IntBoolConsumer andThen(IntBoolConsumer after)
031    {
032        if (after == null)
033            throw new NullPointerException("null has been passed to parameter 'after'");
034
035        return (int i, boolean b) ->
036        {
037            this.accept(i, b); 
038            after.accept(i, b);
039        };
040    }
041
042}