@FunctionalInterface public interface ThrowingLongConsumer extends LongConsumer
long-valued argument and returns no result, possibly throwing an exception.| Modifier and Type | Method and Description |
|---|---|
default void |
accept(long argument)
Performs this operation on the given argument.
|
void |
acceptThrowing(long argument)
Performs this operation on the given argument.
|
default LongConsumer |
fallbackTo(LongConsumer fallback)
Returns a
LongConsumer performing the given operation on the argument if this operation throws an exception. |
default LongConsumer |
fallbackTo(LongConsumer fallback,
Consumer<Exception> exceptionConsumer)
Returns a
LongConsumer performing the given operation on the argument if this operation throws an exception. |
default ThrowingLongConsumer |
orThrow(Class<? extends RuntimeException> exceptionClass)
Returns a
ThrowingLongConsumer throwing an exception of the given type if this operation throws an exception. |
default ThrowingLongConsumer |
orThrow(Class<? extends RuntimeException> exceptionClass,
String message)
Returns a
ThrowingLongConsumer throwing an exception of the given type if this operation throws an exception. |
default ThrowingLongConsumer |
orTryWith(ThrowingLongConsumer other)
Returns a
ThrowingLongConsumer performing the given operation on the argument if this operation throws an exception. |
default ThrowingLongConsumer |
orTryWith(ThrowingLongConsumer other,
Consumer<Exception> exceptionConsumer)
Returns a
ThrowingLongConsumer performing the given operation on the argument if this operation throws an exception. |
andThendefault void accept(long argument)
UncheckedException.accept in interface LongConsumervoid acceptThrowing(long argument)
throws Exception
Exceptiondefault LongConsumer fallbackTo(LongConsumer fallback)
LongConsumer performing the given operation on the argument if this operation throws an exception.IllegalArgumentException - if fallback is nulldefault LongConsumer fallbackTo(LongConsumer fallback, Consumer<Exception> exceptionConsumer)
LongConsumer performing the given operation on the argument if this operation throws an exception.IllegalArgumentException - if fallback is nulldefault ThrowingLongConsumer orThrow(Class<? extends RuntimeException> exceptionClass)
ThrowingLongConsumer 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 ThrowingLongConsumer orThrow(Class<? extends RuntimeException> exceptionClass, String message)
ThrowingLongConsumer 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 ThrowingLongConsumer orTryWith(ThrowingLongConsumer other)
ThrowingLongConsumer performing the given operation on the argument if this operation throws an exception.IllegalArgumentException - if other is nulldefault ThrowingLongConsumer orTryWith(ThrowingLongConsumer other, Consumer<Exception> exceptionConsumer)
ThrowingLongConsumer performing the given operation on the argument if this operation throws an exception.IllegalArgumentException - if other is null