
com.machinezoo.noexception.throwing.ThrowingConsumer 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 Consumer} that allows throwing checked exceptions.
* {@code ThrowingConsumer} is usually implemented by a lambda
* and passed to {@link CheckedExceptionHandler#consumer(ThrowingConsumer)}.
* See NoException tutorial.
*
* @param
* see {@link Consumer}
* @see CheckedExceptionHandler#consumer(ThrowingConsumer)
* @see Consumer
*/
@FunctionalInterface public interface ThrowingConsumer {
/**
* Variation of {@link Consumer#accept(Object)} that allows throwing checked exceptions.
*
* @param t
* see {@link Consumer#accept(Object)}
* @throws Exception
* if unable to complete
* @see CheckedExceptionHandler#consumer(ThrowingConsumer)
* @see Consumer#accept(Object)
*/
void accept(T t) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy