T
- some generic flagE
- The extension@FunctionalInterface public interface ToDoubleFunctionWithThrowable<T,E extends Throwable> extends ToDoubleFunction<T>
Modifier and Type | Method and Description |
---|---|
default double |
applyAsDouble(T v1)
Overridden method of ToDoubleFunctionWithThrowable that will call applyAsDoubleWithThrowable, but catching any exceptions.
|
double |
applyAsDoubleWithThrowable(T v1)
Functional method that will throw exceptions.
|
static <T,E extends Throwable> |
asToDoubleFunctionWithThrowable(ToDoubleFunction<T> todoublefunction)
Utility method to convert ToDoubleFunctionWithThrowable
|
static <T,E extends Throwable> |
aToDoubleFunctionThatUnsafelyThrowsUnchecked(ToDoubleFunctionWithThrowable<T,E> todoublefunctionwiththrowable)
Utility method to unwrap lambdas of type ToDoubleFunction and withUncheckedThrowable any Exception
|
static <T,E extends Throwable> |
castToDoubleFunctionWithThrowable(ToDoubleFunctionWithThrowable<T,E> todoublefunctionwiththrowable)
Utility method to mark lambdas of type ToDoubleFunctionWithThrowable
|
default ToDoubleFunctionWithThrowable<T,E> |
onException(BiConsumer<Throwable,Object[]> consumer) |
default ToDoubleFunctionWithThrowable<T,E> |
onException(Consumer<Throwable> consumer) |
default ToDoubleFunction<T> |
thatReturnsOnCatch(double defaultReturnValue) |
default Function<T,OptionalDouble> |
thatReturnsOptional() |
default ToDoubleFunction<T> |
thatUnsafelyThrowsUnchecked() |
default ToDoubleFunctionWithThrowable<T,E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default ToDoubleFunctionWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default ToDoubleFunctionWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <T,E extends Throwable> ToDoubleFunctionWithThrowable<T,E> castToDoubleFunctionWithThrowable(ToDoubleFunctionWithThrowable<T,E> todoublefunctionwiththrowable)
T
- Generic that corresponds to the same generic on ToDoubleFunctionE
- The type this interface is allowed to throwtodoublefunctionwiththrowable
- The interface instancestatic <T,E extends Throwable> ToDoubleFunction<T> aToDoubleFunctionThatUnsafelyThrowsUnchecked(ToDoubleFunctionWithThrowable<T,E> todoublefunctionwiththrowable) throws E extends Throwable
T
- Generic that corresponds to the same generic on ToDoubleFunctionE
- The type this interface is allowed to throwtodoublefunctionwiththrowable
- The interface instanceE
- the original Exception from todoublefunctionwiththrowableE extends Throwable
static <T,E extends Throwable> ToDoubleFunctionWithThrowable<T,E> asToDoubleFunctionWithThrowable(ToDoubleFunction<T> todoublefunction)
T
- Generic that corresponds to the same generic on ToDoubleFunctionE
- The type this interface is allowed to throwtodoublefunction
- The interface instancedefault double applyAsDouble(T v1)
applyAsDouble
in interface ToDoubleFunction<T>
v1
- parameter to overridden methoddouble applyAsDoubleWithThrowable(T v1) throws E extends Throwable
default Function<T,OptionalDouble> thatReturnsOptional()
default ToDoubleFunction<T> thatReturnsOnCatch(double defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default ToDoubleFunction<T> thatUnsafelyThrowsUnchecked() throws E extends Throwable
default ToDoubleFunctionWithThrowable<T,E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault ToDoubleFunctionWithThrowable<T,E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault ToDoubleFunctionWithThrowable<T,E> withLogging()
default ToDoubleFunctionWithThrowable<T,E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.default ToDoubleFunctionWithThrowable<T,E> onException(BiConsumer<Throwable,Object[]> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.