Interface HexConsumer<A,​B,​C,​D,​E,​F>

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface HexConsumer<A,​B,​C,​D,​E,​F>
    HexConsumer Documentation.

    This is an extension of Java's original functional-interfaces package. The Functional Interface designed here creates a "Hex Consumer" - a straight-forward extension of interface java.util.function.Consumer - but instead has an 'accept(...)' method receiving six variable-type parameters instead of just one.

    NOTE: Java's Basic Package java.util.function.*, contains an interface named BiConsumer, that extends the basic Consumer<T> to interface BiConsumer<T, U>. The interface that is implemented here follows a similar vein, but extends the number of generic type-parameters to six, instead of two.



    • Method Detail

      • accept

        void accept​(A a,
                    B b,
                    C c,
                    D d,
                    E e,
                    F f)
        Performs 'this' operation on the given arguments.
        Parameters:
        a - the first input argument
        b - the second input argument
        c - the third input argument
        d - the fourth input argument
        e - the fifth input argument
        f - the sixth input argument
      • andThen

        default HexConsumer<A,​B,​C,​D,​E,​FandThen​
                    (HexConsumer<? super A,​? super B,​? super C,​? super D,​? super E,​? super F> after)
        
        Returns a composed consumer that performs, in sequence, 'this' operation followed by the 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 'after' operation will not be performed.
        Parameters:
        after - The operation to perform after this operation
        Returns:
        A composed consumer that performs in sequence 'this' operation followed by the 'after' operation.
        Throws:
        java.lang.NullPointerException - if parameter 'other' is null.
        Code:
        Exact Method Body:
        1
        2
        3
        4
        5
        6
        7
        8
         if (after == null)
             throw new NullPointerException("null has been passed to parameter 'after'");
        
         return (A a, B b, C c, D d, E e, F f) ->
         {
             this.accept(a, b, c, d, e, f);
             after.accept(a, b, c, d, e, f);
         };