T
- some generic flagE
- The extension@FunctionalInterface public interface ToLongFunctionWithThrowable<T,E extends Throwable> extends ToLongFunction<T>
Modifier and Type | Method and Description |
---|---|
default long |
applyAsLong(T v1)
Overridden method of ToLongFunctionWithThrowable that will call applyAsLongWithThrowable, but catching any exceptions.
|
long |
applyAsLongWithThrowable(T v1)
Functional method that will throw exceptions.
|
static <T,E extends Throwable> |
asToLongFunctionWithThrowable(ToLongFunction<T> tolongfunction)
Utility method to convert ToLongFunctionWithThrowable
|
static <T,E extends Throwable> |
aToLongFunctionThatUnsafelyThrowsUnchecked(ToLongFunctionWithThrowable<T,E> tolongfunctionwiththrowable)
Utility method to unwrap lambdas of type ToLongFunction and withUncheckedThrowable any Exception
|
static <T,E extends Throwable> |
castToLongFunctionWithThrowable(ToLongFunctionWithThrowable<T,E> tolongfunctionwiththrowable)
Utility method to mark lambdas of type ToLongFunctionWithThrowable
|
default ToLongFunctionWithThrowable<T,E> |
onException(BiConsumer<Throwable,Object[]> consumer) |
default ToLongFunctionWithThrowable<T,E> |
onException(Consumer<Throwable> consumer) |
default ToLongFunction<T> |
thatReturnsOnCatch(long defaultReturnValue) |
default Function<T,OptionalLong> |
thatReturnsOptional() |
default ToLongFunction<T> |
thatUnsafelyThrowsUnchecked() |
default ToLongFunctionWithThrowable<T,E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default ToLongFunctionWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default ToLongFunctionWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <T,E extends Throwable> ToLongFunctionWithThrowable<T,E> castToLongFunctionWithThrowable(ToLongFunctionWithThrowable<T,E> tolongfunctionwiththrowable)
T
- Generic that corresponds to the same generic on ToLongFunctionE
- The type this interface is allowed to throwtolongfunctionwiththrowable
- The interface instancestatic <T,E extends Throwable> ToLongFunction<T> aToLongFunctionThatUnsafelyThrowsUnchecked(ToLongFunctionWithThrowable<T,E> tolongfunctionwiththrowable) throws E extends Throwable
T
- Generic that corresponds to the same generic on ToLongFunctionE
- The type this interface is allowed to throwtolongfunctionwiththrowable
- The interface instanceE
- the original Exception from tolongfunctionwiththrowableE extends Throwable
static <T,E extends Throwable> ToLongFunctionWithThrowable<T,E> asToLongFunctionWithThrowable(ToLongFunction<T> tolongfunction)
T
- Generic that corresponds to the same generic on ToLongFunctionE
- The type this interface is allowed to throwtolongfunction
- The interface instancedefault long applyAsLong(T v1)
applyAsLong
in interface ToLongFunction<T>
v1
- parameter to overridden methodlong applyAsLongWithThrowable(T v1) throws E extends Throwable
default Function<T,OptionalLong> thatReturnsOptional()
default ToLongFunction<T> thatReturnsOnCatch(long defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default ToLongFunction<T> thatUnsafelyThrowsUnchecked() throws E extends Throwable
default ToLongFunctionWithThrowable<T,E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault ToLongFunctionWithThrowable<T,E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault ToLongFunctionWithThrowable<T,E> withLogging()
default ToLongFunctionWithThrowable<T,E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.default ToLongFunctionWithThrowable<T,E> onException(BiConsumer<Throwable,Object[]> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.