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

berlin.yuna.tinkerforgesensor.util.ThrowingRunnable Maven / Gradle / Ivy

package berlin.yuna.tinkerforgesensor.util;

@FunctionalInterface
public interface ThrowingRunnable extends Runnable {
    @Override
    default void run() {
        try {
            tryRun();
        } catch (final Throwable t) {
            throwUnchecked(t);
        }
    }

    private static  void throwUnchecked(Throwable t) {
        throw (E) t;
    }

    void tryRun() throws Throwable;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy