Package pro.horde.os.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 JavaConsumerbut the disparity of exceptions throws.Acceptercan be used in place of JavaConsumerfor operations that will throw anException.Acceptercan only accepts a single input argument and returns no result. Unlike most other functional interfaces,Accepteris expected to operate via side effects.- Since:
- 3.2, 2.0
- Author:
- Bobai Kato
- See Also:
Consumer
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaccept(T t)Performs this operation on the given argument.default Accepter<T>andThen(Accepter<? super T> after)Returns a composedAccepterthat performs, in sequence, this operation followed by theafteroperation.static <T extends Exception>
voidsneakyThrow(Exception ex)
-
-
-
Method Detail
-
andThen
default Accepter<T> andThen(Accepter<? super T> after)
Returns a composedAccepterthat performs, in sequence, this operation followed by theafteroperation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, theafteroperation will not be performed.- Parameters:
after- the operation to perform after this operation- Returns:
- a composed
Consumerthat performs in sequence this operation followed by theafteroperation.
-
sneakyThrow
static <T extends Exception> void sneakyThrow(Exception ex) throws T extends Exception
- Throws:
T extends Exception
-
-