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

no.nav.common.utils.fn.UnsafeSupplier Maven / Gradle / Ivy

The newest version!
package no.nav.common.utils.fn;

import lombok.SneakyThrows;

import java.util.function.Supplier;

@FunctionalInterface
public interface UnsafeSupplier extends Supplier {

    @Override
    @SneakyThrows
    default T get() {
        return unsafeGet();
    }
    T unsafeGet() throws Throwable;

    static UnsafeSupplier toVoid(UnsafeRunnable unsafeRunnable) {
        return ()->{
            unsafeRunnable.run();
            return null;
        };
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy