Interface IOExceptionThrowingConsumer<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 IOExceptionThrowingConsumer<T>
Represents an operation that accepts a single input argument and returns no result. Can potentially throw anIOExceptionwhile doing so.- Since:
- 1.2.0
- Author:
- Ozren Dabić
- See Also:
Consumer
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccept(T t)Performs this operation on the given argument.static <T> Consumer<T>toUnchecked(@NotNull IOExceptionThrowingConsumer<T> consumer)Returns a wrappedConsumerthat performs this operation.
-
-
-
Method Detail
-
accept
void accept(T t) throws IOException
Performs this operation on the given argument.- Parameters:
t- the input argument- Throws:
IOException- if an I/O error occurs
-
toUnchecked
static <T> Consumer<T> toUnchecked(@NotNull @NotNull IOExceptionThrowingConsumer<T> consumer)
Returns a wrappedConsumerthat performs this operation. If performing said operation results in anIOException, it is re-thrown as its unchecked counterpart:UncheckedIOException.- Type Parameters:
T- the type of the input to the operation- Parameters:
consumer- the operation to wrap- Returns:
- and identical
Consumerthat throwsUncheckedIOExceptioninstead - Throws:
NullPointerException- ifconsumeris null
-
-