R
- some generic flagE
- The extension@FunctionalInterface public interface DoubleFunctionWithThrowable<R,E extends Throwable> extends DoubleFunction<R>
Modifier and Type | Method and Description |
---|---|
static <R,E extends Throwable> |
aDoubleFunctionThatUnsafelyThrowsUnchecked(DoubleFunctionWithThrowable<R,E> doublefunctionwiththrowable)
Utility method to unwrap lambdas of type DoubleFunction and withUncheckedThrowable any Exception
|
default R |
apply(double v1)
Overridden method of DoubleFunctionWithThrowable that will call applyWithThrowable, but catching any exceptions.
|
R |
applyWithThrowable(double v1)
Functional method that will throw exceptions.
|
static <R,E extends Throwable> |
asDoubleFunctionWithThrowable(DoubleFunction<R> doublefunction)
Utility method to convert DoubleFunctionWithThrowable
|
static <R,E extends Throwable> |
castDoubleFunctionWithThrowable(DoubleFunctionWithThrowable<R,E> doublefunctionwiththrowable)
Utility method to mark lambdas of type DoubleFunctionWithThrowable
|
default DoubleFunctionWithThrowable<R,E> |
onException(BiConsumer<Throwable,Object[]> consumer) |
default DoubleFunctionWithThrowable<R,E> |
onException(Consumer<Throwable> consumer) |
default DoubleFunction<R> |
thatReturnsOnCatch(R defaultReturnValue) |
default DoubleFunction<Optional<R>> |
thatReturnsOptional() |
default DoubleFunction<R> |
thatUnsafelyThrowsUnchecked() |
default DoubleFunctionWithThrowable<R,E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default DoubleFunctionWithThrowable<R,E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default DoubleFunctionWithThrowable<R,E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <R,E extends Throwable> DoubleFunctionWithThrowable<R,E> castDoubleFunctionWithThrowable(DoubleFunctionWithThrowable<R,E> doublefunctionwiththrowable)
R
- Generic that corresponds to the same generic on DoubleFunctionE
- The type this interface is allowed to throwdoublefunctionwiththrowable
- The interface instancestatic <R,E extends Throwable> DoubleFunction<R> aDoubleFunctionThatUnsafelyThrowsUnchecked(DoubleFunctionWithThrowable<R,E> doublefunctionwiththrowable) throws E extends Throwable
R
- Generic that corresponds to the same generic on DoubleFunctionE
- The type this interface is allowed to throwdoublefunctionwiththrowable
- The interface instanceE
- the original Exception from doublefunctionwiththrowableE extends Throwable
static <R,E extends Throwable> DoubleFunctionWithThrowable<R,E> asDoubleFunctionWithThrowable(DoubleFunction<R> doublefunction)
R
- Generic that corresponds to the same generic on DoubleFunctionE
- The type this interface is allowed to throwdoublefunction
- The interface instancedefault R apply(double v1)
apply
in interface DoubleFunction<R>
v1
- parameter to overridden methodR applyWithThrowable(double v1) throws E extends Throwable
default DoubleFunction<Optional<R>> thatReturnsOptional()
default DoubleFunction<R> thatReturnsOnCatch(R defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default DoubleFunction<R> thatUnsafelyThrowsUnchecked() throws E extends Throwable
default DoubleFunctionWithThrowable<R,E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault DoubleFunctionWithThrowable<R,E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault DoubleFunctionWithThrowable<R,E> withLogging()
default DoubleFunctionWithThrowable<R,E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.default DoubleFunctionWithThrowable<R,E> onException(BiConsumer<Throwable,Object[]> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.