Package art.cutils.function
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 JavaConsumer
but the disparity of exceptions throws.Accepter
can be used in place of JavaConsumer
for operations that will throw anException
.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 Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
accept(T t)
Performs this operation on the given argument.default Accepter<T>
andThen(Accepter<? super T> after)
Returns a composedAccepter
that performs, in sequence, this operation followed by theafter
operation.static <T extends Exception>
voidsneakyThrow(Exception ex)
-
-
-
Method Detail
-
andThen
default Accepter<T> andThen(Accepter<? super T> after)
Returns a composedAccepter
that performs, in sequence, this operation followed by theafter
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, theafter
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 theafter
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
-
-