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