Interface Accepter<T>

  • Type Parameters:
    T - the type of the input to the operation.
    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 Accepter<T>
    This is similar to Java Consumer but the disparity of exceptions throws. Accepter can be used in place of Java Consumer for operations that will throw an Exception. Accepter can only accepts a single input argument and returns no result. Unlike most other functional interfaces, Accepter is expected to operate via side effects.
    Since:
    1.0, 1.0
    Author:
    , Bobai Kato
    See Also:
    Consumer
    • Method Detail

      • andThen

        default Accepter<T> andThen​(Accepter<? super T> after)
        Returns a composed Accepter 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.
      • accept

        void accept​(T t)
             throws Exception
        Performs this operation on the given argument.
        Parameters:
        t - the input argument.
        Throws:
        Exception - throws accepter exception