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

net.diversionmc.error.TryR Maven / Gradle / Ivy

There is a newer version: 1.29.2
Show newest version
package net.diversionmc.error;

@FunctionalInterface
public interface TryR extends Runnable {
    void tryRun() throws E;

    @SuppressWarnings("OverlyBroadCatchBlock")
    default void run() {
        try {
            tryRun();
        } catch (Exception e) {
            throw new ResultException(e);
        }
    }

    static  TryR of(Runnable f) {
        return f::run;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy