![JAR search and dependency download from the Maven repository](/logo.png)
co.pragmati.function.unchecked.UncheckedConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of func-commons Show documentation
Show all versions of func-commons Show documentation
Java 8 common library with extended functions
The newest version!
package co.pragmati.function.unchecked;
import java.util.function.Consumer;
/**
* Consumer that throws unchecked exceptions
* @param
*
* @author jmbataller
*/
@FunctionalInterface
public interface UncheckedConsumer extends Consumer {
void acceptThrows(T t) throws Exception;
@Override
default void accept(T t) {
try {
acceptThrows(t);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy