net.neoremind.fountain.NotNullClosurePredicate Maven / Gradle / Ivy
package net.neoremind.fountain;
/**
* 对象不为空的条件验证
*
* @author zhangxu
*/
class NotNullClosurePredicate extends AbstractClosurePredicate implements ClosurePredicate {
public NotNullClosurePredicate(T t) {
super(t);
}
/**
* 静态构造方法
*
* @param t 待验证对象
* @param 对象的类型
*
* @return 对象不为空的条件验证
*/
public static NotNullClosurePredicate of(T t) {
return new NotNullClosurePredicate(t);
}
@Override
public boolean doApply() {
return t != null;
}
@Override
public boolean canApply() {
return true;
}
}