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