java.util.function.LongSupplier@FunctionalInterface
public interface ThrowingLongSupplier
extends java.util.function.LongSupplier
long-valued results, possibly throwing an exception.| Modifier and Type | Method | Description |
|---|---|---|
default java.util.function.LongSupplier |
fallbackTo(java.util.function.LongSupplier fallback) |
Returns a
LongSupplier returning from the given supplier if this supplier throws an exception. |
default java.util.function.LongSupplier |
fallbackTo(java.util.function.LongSupplier fallback,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
LongSupplier returning from the given supplier if this supplier throws an exception. |
default long |
getAsLong() |
Returns a result.
|
long |
getAsLongThrowing() |
Returns a result.
|
default java.util.function.LongSupplier |
orReturn(long value) |
Returns a
LongSupplier returning the given value if this supplier throws an exception. |
default java.util.function.LongSupplier |
orReturn(long value,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
LongSupplier returning the given value if this supplier throws an exception. |
default ThrowingLongSupplier |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass) |
Returns a
ThrowingLongSupplier throwing an exception of the given type if this supplier throws an exception. |
default ThrowingLongSupplier |
orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass,
java.lang.String message) |
Returns a
ThrowingLongSupplier throwing an exception of the given type if this supplier throws an exception. |
default ThrowingLongSupplier |
orTryWith(ThrowingLongSupplier other) |
Returns a
ThrowingLongSupplier returning from the given supplier if this supplier throws an exception. |
default ThrowingLongSupplier |
orTryWith(ThrowingLongSupplier other,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer) |
Returns a
ThrowingLongSupplier returning from the given supplier if this supplier throws an exception. |
default java.util.function.LongSupplier fallbackTo(java.util.function.LongSupplier fallback)
LongSupplier returning from the given supplier if this supplier throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault java.util.function.LongSupplier fallbackTo(java.util.function.LongSupplier fallback,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
LongSupplier returning from the given supplier if this supplier throws an exception.java.lang.IllegalArgumentException - if fallback is nulldefault long getAsLong()
UncheckedException.getAsLong in interface java.util.function.LongSupplierlong getAsLongThrowing()
throws java.lang.Exception
java.lang.Exceptiondefault java.util.function.LongSupplier orReturn(long value)
LongSupplier returning the given value if this supplier throws an exception.default java.util.function.LongSupplier orReturn(long value,
java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
LongSupplier returning the given value if this supplier throws an exception.default ThrowingLongSupplier orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass)
ThrowingLongSupplier 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 ThrowingLongSupplier orThrow(java.lang.Class<? extends java.lang.RuntimeException> exceptionClass, java.lang.String message)
ThrowingLongSupplier 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 ThrowingLongSupplier orTryWith(ThrowingLongSupplier other)
ThrowingLongSupplier returning from the given supplier if this supplier throws an exception.java.lang.IllegalArgumentException - if other is nulldefault ThrowingLongSupplier orTryWith(ThrowingLongSupplier other, java.util.function.Consumer<java.lang.Exception> exceptionConsumer)
ThrowingLongSupplier returning from the given supplier if this supplier throws an exception.java.lang.IllegalArgumentException - if other is null