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