io.alapierre.func.NullUtil Maven / Gradle / Ivy
package io.alapierre.func;
import java.util.function.Function;
/**
* @author Adrian Lapierre {@literal [email protected]}
* Copyrights by original author 2016.08.03
*/
public class NullUtil {
private NullUtil() {
}
public static R ifNotNull(T value, Function valueMapper) {
if(value != null) return valueMapper.apply(value);
return null;
}
}