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

com.machinezoo.noexception.throwing.ThrowingRunnable Maven / Gradle / Ivy

Go to download

Makes exception handling concise and beautiful, yet architecturally clean and flexible.

There is a newer version: 1.9.1
Show newest version
// Part of NoException: https://noexception.machinezoo.com
package com.machinezoo.noexception.throwing;

import com.machinezoo.noexception.*;

/**
 * Variation of {@link Runnable} that allows throwing checked exceptions.
 * {@code ThrowingRunnable} is usually implemented by a lambda
 * and passed to {@link CheckedExceptionHandler#runnable(ThrowingRunnable)}.
 * See NoException tutorial.
 * 
 * @see CheckedExceptionHandler#runnable(ThrowingRunnable)
 * @see Runnable
 */
@FunctionalInterface public interface ThrowingRunnable {
	/**
	 * Variation of {@link Runnable#run()} that allows throwing checked exceptions.
	 * 
	 * @throws Exception
	 *             if unable to complete
	 * @see CheckedExceptionHandler#runnable(ThrowingRunnable)
	 * @see Runnable#run()
	 */
	void run() throws Exception;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy