java.util.function.IntConsumer@FunctionalInterface
public interface ThrowingIntConsumer
extends java.util.function.IntConsumer
double-valued argument and returns no result, possibly throwing an exception.| Modifier and Type | Method | 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 java.util.function.IntConsumer |
fallbackTo(java.util.function.IntConsumer fallback) |
Returns an
IntConsumer performing the given operation on the argument if this operation throws an exception. |
default java.util.function.IntConsumer |
fallbackTo(java.util.function.IntConsumer fallback,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns an
IntConsumer performing the given operation on the argument if this operation throws an exception. |
default ThrowingIntConsumer |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass) |
Returns a
ThrowingIntConsumer throwing an exception of the given type if this operation throws an exception. |
default ThrowingIntConsumer |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass,
java.lang.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,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
ThrowingIntConsumer performing the given operation on the argument if this operation throws an exception. |
default void accept(int argument)
UncheckedException.accept in interface java.util.function.IntConsumervoid acceptThrowing(int argument)
throws java.lang.Exception
java.lang.Exceptiondefault java.util.function.IntConsumer fallbackTo(java.util.function.IntConsumer fallback)
IntConsumer performing the given operation on the argument if this operation throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault java.util.function.IntConsumer fallbackTo(java.util.function.IntConsumer fallback,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
IntConsumer performing the given operation on the argument if this operation throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault ThrowingIntConsumer orThrow(java.lang.Class<? extends java.lang.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.
java.lang.IllegalArgumentException - if exceptionClass is nulldefault ThrowingIntConsumer orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass, java.lang.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.
java.lang.IllegalArgumentException - if exceptionClass is nulldefault ThrowingIntConsumer orTryWith(ThrowingIntConsumer other)
ThrowingIntConsumer performing the given operation on the argument if this operation throws an exception.java.lang.IllegalArgumentException - if other is nulldefault ThrowingIntConsumer orTryWith(ThrowingIntConsumer other, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
ThrowingIntConsumer performing the given operation on the argument if this operation throws an exception.java.lang.IllegalArgumentException - if other is null