E
- The extension@FunctionalInterface public interface LongSupplierWithThrowable<E extends Throwable> extends LongSupplier
Modifier and Type | Method and Description |
---|---|
static <E extends Throwable> |
aLongSupplierThatUnsafelyThrowsUnchecked(LongSupplierWithThrowable<E> longsupplierwiththrowable)
Utility method to unwrap lambdas of type LongSupplier and withUncheckedThrowable any Exception
|
static <E extends Throwable> |
asLongSupplierWithThrowable(LongSupplier longsupplier)
Utility method to convert LongSupplierWithThrowable
|
static <E extends Throwable> |
castLongSupplierWithThrowable(LongSupplierWithThrowable<E> longsupplierwiththrowable)
Utility method to mark lambdas of type LongSupplierWithThrowable
|
default long |
getAsLong()
Overridden method of LongSupplierWithThrowable that will call getAsLongWithThrowable, but catching any exceptions.
|
long |
getAsLongWithThrowable()
Functional method that will throw exceptions.
|
default LongSupplierWithThrowable<E> |
onException(Consumer<Throwable> consumer) |
default LongSupplier |
thatReturnsOnCatch(long defaultReturnValue) |
default LongSupplier |
thatUnsafelyThrowsUnchecked() |
default LongSupplierWithThrowable<E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default LongSupplierWithThrowable<E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default LongSupplierWithThrowable<E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <E extends Throwable> LongSupplierWithThrowable<E> castLongSupplierWithThrowable(LongSupplierWithThrowable<E> longsupplierwiththrowable)
E
- The type this interface is allowed to throwlongsupplierwiththrowable
- The interface instancestatic <E extends Throwable> LongSupplier aLongSupplierThatUnsafelyThrowsUnchecked(LongSupplierWithThrowable<E> longsupplierwiththrowable) throws E extends Throwable
E
- The type this interface is allowed to throwlongsupplierwiththrowable
- The interface instanceE
- the original Exception from longsupplierwiththrowableE extends Throwable
static <E extends Throwable> LongSupplierWithThrowable<E> asLongSupplierWithThrowable(LongSupplier longsupplier)
E
- The type this interface is allowed to throwlongsupplier
- The interface instancedefault long getAsLong()
getAsLong
in interface LongSupplier
long getAsLongWithThrowable() throws E extends Throwable
default LongSupplier thatReturnsOnCatch(long defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default LongSupplier thatUnsafelyThrowsUnchecked() throws E extends Throwable
default LongSupplierWithThrowable<E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault LongSupplierWithThrowable<E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault LongSupplierWithThrowable<E> withLogging()
default LongSupplierWithThrowable<E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.