E
- The extension@FunctionalInterface public interface DoubleSupplierWithThrowable<E extends Throwable> extends DoubleSupplier
Modifier and Type | Method and Description |
---|---|
static <E extends Throwable> |
aDoubleSupplierThatUnsafelyThrowsUnchecked(DoubleSupplierWithThrowable<E> doublesupplierwiththrowable)
Utility method to unwrap lambdas of type DoubleSupplier and withUncheckedThrowable any Exception
|
static <E extends Throwable> |
asDoubleSupplierWithThrowable(DoubleSupplier doublesupplier)
Utility method to convert DoubleSupplierWithThrowable
|
static <E extends Throwable> |
castDoubleSupplierWithThrowable(DoubleSupplierWithThrowable<E> doublesupplierwiththrowable)
Utility method to mark lambdas of type DoubleSupplierWithThrowable
|
default double |
getAsDouble()
Overridden method of DoubleSupplierWithThrowable that will call getAsDoubleWithThrowable, but catching any exceptions.
|
double |
getAsDoubleWithThrowable()
Functional method that will throw exceptions.
|
default DoubleSupplierWithThrowable<E> |
onException(Consumer<Throwable> consumer) |
default DoubleSupplier |
thatReturnsOnCatch(double defaultReturnValue) |
default DoubleSupplier |
thatUnsafelyThrowsUnchecked() |
default DoubleSupplierWithThrowable<E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default DoubleSupplierWithThrowable<E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default DoubleSupplierWithThrowable<E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <E extends Throwable> DoubleSupplierWithThrowable<E> castDoubleSupplierWithThrowable(DoubleSupplierWithThrowable<E> doublesupplierwiththrowable)
E
- The type this interface is allowed to throwdoublesupplierwiththrowable
- The interface instancestatic <E extends Throwable> DoubleSupplier aDoubleSupplierThatUnsafelyThrowsUnchecked(DoubleSupplierWithThrowable<E> doublesupplierwiththrowable) throws E extends Throwable
E
- The type this interface is allowed to throwdoublesupplierwiththrowable
- The interface instanceE
- the original Exception from doublesupplierwiththrowableE extends Throwable
static <E extends Throwable> DoubleSupplierWithThrowable<E> asDoubleSupplierWithThrowable(DoubleSupplier doublesupplier)
E
- The type this interface is allowed to throwdoublesupplier
- The interface instancedefault double getAsDouble()
getAsDouble
in interface DoubleSupplier
double getAsDoubleWithThrowable() throws E extends Throwable
default DoubleSupplier thatReturnsOnCatch(double defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default DoubleSupplier thatUnsafelyThrowsUnchecked() throws E extends Throwable
default DoubleSupplierWithThrowable<E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault DoubleSupplierWithThrowable<E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault DoubleSupplierWithThrowable<E> withLogging()
default DoubleSupplierWithThrowable<E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.