Skip to content

Instantly share code, notes, and snippets.

View burythehammer's full-sized avatar
🐝

Matt Long burythehammer

🐝
View GitHub Profile
@burythehammer
burythehammer / Nonchalantly.java
Created June 2, 2017 17:22 — forked from poetix/Nonchalantly.java
A Java 8 class for when you just don't give a fuck about that checked exception
public interface Nonchalantly<T> {
static <T, E extends Throwable> T invoke(Nonchalantly<T> f) throws E {
try {
return f.run();
} catch (Throwable e) {
throw (E) e;
}
}
T run() throws Throwable;