Skip to content

Instantly share code, notes, and snippets.

@robvalk
robvalk / Safely.java
Created March 6, 2012 09:15 — forked from jonseymour/type-and-null-safe-meta-data.txt
Null and type safe meta data for Java
// given
public abstract class Safely<R, V> {
public final V from(R root) {
try{
return access(root)
} catch(NullPointerException npe) {
return null;
}
}