All Downloads are FREE. Search and download functionalities are using the official Maven repository.

yeamy.utils.IfNotNull Maven / Gradle / Ivy

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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy