16 lines
366 B
Java
16 lines
366 B
Java
package it.cavallium.strangedb.functionalinterfaces;
|
|
|
|
import java.io.IOException;
|
|
import java.util.Objects;
|
|
|
|
@FunctionalInterface
|
|
public interface ConsumerWithIO<T> {
|
|
|
|
void accept(T t) throws IOException;
|
|
|
|
default ConsumerWithIO<T> andThen(ConsumerWithIO<? super T> after) {
|
|
Objects.requireNonNull(after);
|
|
return (T t) -> { accept(t); after.accept(t); };
|
|
}
|
|
}
|