Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created September 22, 2016 14:42
Show Gist options
  • Save nwillc/6ddc7eb4ce0a73662e3efeabca85ca6c to your computer and use it in GitHub Desktop.
Save nwillc/6ddc7eb4ce0a73662e3efeabca85ca6c to your computer and use it in GitHub Desktop.
@FunctionalInterface
public interface ThrowingBiFunction<T, U, R> extends BiFunction<T, U, R> {
@Override
default R apply(T t, U u) {
try {
return applyThrows(t, u);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
R applyThrows(T t, U u) throws Exception;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment