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

hm.binkley.util.function.ThrowingSupplier Maven / Gradle / Ivy

The newest version!
package hm.binkley.util.function;

import java.util.function.Supplier;

/**
 * {@code ThrowingSupplier} is a throwing look-a=like of {@link Supplier}.  It cannot be a
 * {@code Supplier} as it takes throwing versions of suppliers.  Otherwise it is a faithful
 * reproduction.
 *
 * @author B. K. Oxley (binkley)
 */
@SuppressWarnings("JavaDoc")
@FunctionalInterface
public interface ThrowingSupplier {
    /** @see Supplier#get() */
    T get()
            throws E, InterruptedException;

    /** Creates a facade {@code Supplier} wrapping this throwing one. */
    default  Supplier asSupplier(final Defer defer) {
        return () -> defer.as(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy