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

org.gemini4j.utils.NoExceptions Maven / Gradle / Ivy

The newest version!
package org.gemini4j.utils;

public class NoExceptions {
    public static  T noex(final ThrowingSupplier o) {
        try {
            return o.get();
        } catch (final Exception e) {
            throw new RuntimeException(e);
        }
    }

    public static void noex(final ThrowingRunnable r) {
        try {
            r.run();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public interface ThrowingSupplier {
        T get() throws Exception;
    }

    public interface ThrowingRunnable {
        void run() throws Exception;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy