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