@FunctionalInterface public interface ThrowingIntConsumer extends IntConsumer
double-valued argument and returns no result, possibly throwing an exception.| Modifier and Type | Method and Description |
|---|---|
default void |
accept(int argument)
Performs this operation on the given argument.
|
void |
acceptThrowing(int argument)
Performs this operation on the given argument.
|
default IntConsumer |
fallbackTo(IntConsumer fallback)
Returns an
IntConsumer performing the given operation on the argument if this operation throws an exception. |
default IntConsumer |
fallbackTo(IntConsumer fallback,
Consumer<Exception> exceptionConsumer)
Returns an
IntConsumer performing the given operation on the argument if this operation throws an exception. |
default ThrowingIntConsumer |
orThrow(Class<? extends RuntimeException> exceptionClass)
Returns a
ThrowingIntConsumer throwing an exception of the given type if this operation throws an exception. |
default ThrowingIntConsumer |
orThrow(Class<? extends RuntimeException> exceptionClass,
String message)
Returns a
ThrowingIntConsumer throwing an exception of the given type if this operation throws an exception. |
default ThrowingIntConsumer |
orTryWith(ThrowingIntConsumer other)
Returns a
ThrowingIntConsumer performing the given operation on the argument if this operation throws an exception. |
default ThrowingIntConsumer |
orTryWith(ThrowingIntConsumer other,
Consumer<Exception> exceptionConsumer)
Returns a
ThrowingIntConsumer performing the given operation on the argument if this operation throws an exception. |
andThendefault void accept(int argument)
UncheckedException.accept in interface IntConsumervoid acceptThrowing(int argument)
throws Exception
Exceptiondefault IntConsumer fallbackTo(IntConsumer fallback)
IntConsumer performing the given operation on the argument if this operation throws an exception.IllegalArgumentException - if fallback is nulldefault IntConsumer fallbackTo(IntConsumer fallback, Consumer<Exception> exceptionConsumer)
IntConsumer performing the given operation on the argument if this operation throws an exception.IllegalArgumentException - if fallback is nulldefault ThrowingIntConsumer orThrow(Class<? extends RuntimeException> exceptionClass)
ThrowingIntConsumer throwing an exception of the given type if this operation throws an exception.
The original exception thrown by this operation is the cause of the thrown exception.
The exception class must have a constructor accepting a single Throwable as an argument.
IllegalArgumentException - if exceptionClass is nulldefault ThrowingIntConsumer orThrow(Class<? extends RuntimeException> exceptionClass, String message)
ThrowingIntConsumer throwing an exception of the given type if this operation throws an exception.
The original exception thrown by this operation is the cause of the thrown exception.
The exception class must have a constructor accepting String and Throwable as arguments.
IllegalArgumentException - if exceptionClass is nulldefault ThrowingIntConsumer orTryWith(ThrowingIntConsumer other)
ThrowingIntConsumer performing the given operation on the argument if this operation throws an exception.IllegalArgumentException - if other is nulldefault ThrowingIntConsumer orTryWith(ThrowingIntConsumer other, Consumer<Exception> exceptionConsumer)
ThrowingIntConsumer performing the given operation on the argument if this operation throws an exception.IllegalArgumentException - if other is null