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