net.dongliu.commons.lang.Requires Maven / Gradle / Ivy
package net.dongliu.commons.lang;
/**
* @author Dong Liu
*/
public class Requires {
/**
* if o is null, throw nullPointerException; else return o
*/
public static T notNull(T o) {
if (o == null) {
throw new NullPointerException();
}
return o;
}
}