Package com.globalmentor.io.function
Interface IOConsumer<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 IOConsumer<T>
Represents an I/O operation that accepts a single input argument and returns no result.This interface is similar to
Consumer
except that it is allowed to throw anIOException
.- Author:
- Garret Wilson
- See Also:
Consumer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
accept(T t)
This method is the same asConsumer.accept(Object)
, but with a support forIOException
.default IOConsumer<T>
andThen(IOConsumer<? super T> after)
This method is the same asConsumer.andThen(Consumer)
, but with a support forIOException
.
-
-
-
Method Detail
-
accept
void accept(@Nonnull T t) throws java.io.IOException
This method is the same as
Consumer.accept(Object)
, but with a support forIOException
.- Parameters:
t
- the input argument- Throws:
java.io.IOException
- if there is an I/O error performing the operation
-
andThen
default IOConsumer<T> andThen(@Nonnull IOConsumer<? super T> after) throws java.io.IOException
This method is the same as
Consumer.andThen(Consumer)
, but with a support forIOException
.- Parameters:
after
- The operation to perform after this operation.- Returns:
- A consumer that performs this operation followed by the given operation in sequence.
- Throws:
java.io.IOException
- if there is an I/O error performing the operation.
-
-