
com.machinezoo.noexception.throwing.ThrowingSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of noexception Show documentation
Show all versions of noexception Show documentation
Makes exception handling concise and beautiful, yet architecturally clean and flexible.
// Part of NoException: https://noexception.machinezoo.com
package com.machinezoo.noexception.throwing;
import java.util.function.*;
import com.machinezoo.noexception.*;
/**
* Variation of {@link Supplier} that allows throwing checked exceptions.
* {@code ThrowingSupplier} is usually implemented by a lambda
* and passed to {@link CheckedExceptionHandler#supplier(ThrowingSupplier)}.
* See noexception tutorial.
*
* @param
* see {@link Supplier}
* @see CheckedExceptionHandler#supplier(ThrowingSupplier)
* @see Supplier
*/
@FunctionalInterface public interface ThrowingSupplier {
/**
* Variation of {@link Supplier#get()} that allows throwing checked exceptions.
*
* @return see {@link Supplier#get()}
* @throws Exception
* if unable to complete
* @see CheckedExceptionHandler#supplier(ThrowingSupplier)
* @see Supplier#get()
*/
T get() throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy