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