![JAR search and dependency download from the Maven repository](/logo.png)
co.pragmati.function.unchecked.UncheckedBiConsumer Maven / Gradle / Ivy
package co.pragmati.function.unchecked;
import java.util.function.BiConsumer;
/**
* BiConsumer that throws unchecked exceptions
* @param
* @param
*
* @author jmbataller
*/
public interface UncheckedBiConsumer extends BiConsumer {
void acceptThrows(T t, U u) throws Exception;
@Override
default void accept(T t, U u) {
try {
acceptThrows(t, u);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy