java.util.function.LongFunction<R>@FunctionalInterface
public interface ThrowingLongFunction<R>
extends java.util.function.LongFunction<R>
long-valued argument and produces a result, possibly throwing an exception.| Modifier and Type | Method | Description |
|---|---|---|
default R |
apply(long argument) |
Applies this function to the given argument.
|
R |
applyThrowing(long argument) |
Applies this function to the given argument.
|
default java.util.function.LongFunction<R> |
fallbackTo(java.util.function.LongFunction<R> fallback) |
Returns a
LongFunction applying the given function to the argument if this function throws an exception. |
default java.util.function.LongFunction<R> |
fallbackTo(java.util.function.LongFunction<R> fallback,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
LongFunction applying the given function to the argument if this function throws an exception. |
default java.util.function.LongFunction<R> |
orReturn(R value) |
Returns a
LongFunction returning the given value if this function throws an exception. |
default java.util.function.LongFunction<R> |
orReturn(R value,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
LongFunction returning the given value if this function throws an exception. |
default ThrowingLongFunction<R> |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass) |
Returns a
ThrowingLongFunction throwing an exception of the given type if this function throws an exception. |
default ThrowingLongFunction<R> |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass,
java.lang.String message) |
Returns a
ThrowingLongFunction throwing an exception of the given type if this function throws an exception. |
default ThrowingLongFunction<R> |
orTryWith(ThrowingLongFunction<? extends R> other) |
Returns a
ThrowingLongFunction applying the given function to the argument if this function throws an exception. |
default ThrowingLongFunction<R> |
orTryWith(ThrowingLongFunction<? extends R> other,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
ThrowingLongFunction applying the given function to the argument if this function throws an exception. |
default R apply(long argument)
UncheckedException.apply in interface java.util.function.LongFunction<R>R applyThrowing(long argument) throws java.lang.Exception
java.lang.Exceptiondefault java.util.function.LongFunction<R> fallbackTo(java.util.function.LongFunction<R> fallback)
LongFunction applying the given function to the argument if this function throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault java.util.function.LongFunction<R> fallbackTo(java.util.function.LongFunction<R> fallback, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
LongFunction applying the given function to the argument if this function throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault java.util.function.LongFunction<R> orReturn(R value)
LongFunction returning the given value if this function throws an exception.default java.util.function.LongFunction<R> orReturn(R value, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
LongFunction returning the given value if this function throws an exception.default ThrowingLongFunction<R> orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
ThrowingLongFunction throwing an exception of the given type if this function throws an exception.
The original exception thrown by this function 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 ThrowingLongFunction<R> orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass, java.lang.String message)
ThrowingLongFunction throwing an exception of the given type if this function throws an exception.
The original exception thrown by this function 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 ThrowingLongFunction<R> orTryWith(ThrowingLongFunction<? extends R> other)
ThrowingLongFunction applying the given function to the argument if this function throws an exception.java.lang.IllegalArgumentException - if other is nulldefault ThrowingLongFunction<R> orTryWith(ThrowingLongFunction<? extends R> other, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
ThrowingLongFunction applying the given function to the argument if this function throws an exception.java.lang.IllegalArgumentException - if other is null