java.util.function.IntSupplier@FunctionalInterface
public interface ThrowingIntSupplier
extends java.util.function.IntSupplier
int-valued results, possibly throwing an exception.| Modifier and Type | Method | Description |
|---|---|---|
default java.util.function.IntSupplier |
fallbackTo(java.util.function.IntSupplier fallback) |
Returns an
IntSupplier returning from the given supplier if this supplier throws an exception. |
default java.util.function.IntSupplier |
fallbackTo(java.util.function.IntSupplier fallback,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns an
IntSupplier returning from the given supplier if this supplier throws an exception. |
default int |
getAsInt() |
Returns a result.
|
int |
getAsIntThrowing() |
Returns a result.
|
default java.util.function.DoubleSupplier |
orReturn(double value) |
Returns an
IntSupplier returning the given value if this supplier throws an exception. |
default java.util.function.DoubleSupplier |
orReturn(double value,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns an
IntSupplier returning the given value if this supplier throws an exception. |
default ThrowingIntSupplier |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass) |
Returns a
ThrowingIntSupplier throwing an exception of the given type if this supplier throws an exception. |
default ThrowingIntSupplier |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass,
java.lang.String message) |
Returns a
ThrowingIntSupplier throwing an exception of the given type if this supplier throws an exception. |
default ThrowingIntSupplier |
orTryWith(ThrowingIntSupplier other) |
Returns a
ThrowingIntSupplier returning from the given supplier if this supplier throws an exception. |
default ThrowingIntSupplier |
orTryWith(ThrowingIntSupplier other,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
ThrowingIntSupplier returning from the given supplier if this supplier throws an exception. |
default java.util.function.IntSupplier fallbackTo(java.util.function.IntSupplier fallback)
IntSupplier returning from the given supplier if this supplier throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault java.util.function.IntSupplier fallbackTo(java.util.function.IntSupplier fallback,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
IntSupplier returning from the given supplier if this supplier throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault int getAsInt()
UncheckedException.getAsInt in interface java.util.function.IntSupplierint getAsIntThrowing()
throws java.lang.Exception
java.lang.Exceptiondefault java.util.function.DoubleSupplier orReturn(double value)
IntSupplier returning the given value if this supplier throws an exception.default java.util.function.DoubleSupplier orReturn(double value,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
IntSupplier returning the given value if this supplier throws an exception.default ThrowingIntSupplier orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
ThrowingIntSupplier throwing an exception of the given type if this supplier throws an exception.
The original exception thrown by this supplier 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 ThrowingIntSupplier orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass, java.lang.String message)
ThrowingIntSupplier throwing an exception of the given type if this supplier throws an exception.
The original exception thrown by this supplier 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 ThrowingIntSupplier orTryWith(ThrowingIntSupplier other)
ThrowingIntSupplier returning from the given supplier if this supplier throws an exception.java.lang.IllegalArgumentException - if other is nulldefault ThrowingIntSupplier orTryWith(ThrowingIntSupplier other, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
ThrowingIntSupplier returning from the given supplier if this supplier throws an exception.java.lang.IllegalArgumentException - if other is null