yeamy.utils.IfNotNull Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of restlite-core Show documentation
Show all versions of restlite-core Show documentation
Helps you with RESTful style servlet developments.
The newest version!
package yeamy.utils;
public class IfNotNull {
public static R invoke(T in, Function run) {
if (in == null) return null;
try {
return run.apply(in);
} catch (Exception e) {
return null;
}
}
//import java.util.function.Function;
public interface Function {
R apply(I t) throws Exception;
}
}