E
- The extension@FunctionalInterface public interface LongToIntFunctionWithThrowable<E extends Throwable> extends LongToIntFunction
Modifier and Type | Method and Description |
---|---|
static <E extends Throwable> |
aLongToIntFunctionThatUnsafelyThrowsUnchecked(LongToIntFunctionWithThrowable<E> longtointfunctionwiththrowable)
Utility method to unwrap lambdas of type LongToIntFunction and withUncheckedThrowable any Exception
|
default int |
applyAsInt(long v1)
Overridden method of LongToIntFunctionWithThrowable that will call applyAsIntWithThrowable, but catching any exceptions.
|
int |
applyAsIntWithThrowable(long v1)
Functional method that will throw exceptions.
|
static <E extends Throwable> |
asLongToIntFunctionWithThrowable(LongToIntFunction longtointfunction)
Utility method to convert LongToIntFunctionWithThrowable
|
static <E extends Throwable> |
castLongToIntFunctionWithThrowable(LongToIntFunctionWithThrowable<E> longtointfunctionwiththrowable)
Utility method to mark lambdas of type LongToIntFunctionWithThrowable
|
default LongToIntFunctionWithThrowable<E> |
onException(BiConsumer<Throwable,Object[]> consumer) |
default LongToIntFunctionWithThrowable<E> |
onException(Consumer<Throwable> consumer) |
default LongToIntFunction |
thatReturnsOnCatch(int defaultReturnValue) |
default LongToIntFunction |
thatUnsafelyThrowsUnchecked() |
default LongToIntFunctionWithThrowable<E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default LongToIntFunctionWithThrowable<E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default LongToIntFunctionWithThrowable<E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <E extends Throwable> LongToIntFunctionWithThrowable<E> castLongToIntFunctionWithThrowable(LongToIntFunctionWithThrowable<E> longtointfunctionwiththrowable)
E
- The type this interface is allowed to throwlongtointfunctionwiththrowable
- The interface instancestatic <E extends Throwable> LongToIntFunction aLongToIntFunctionThatUnsafelyThrowsUnchecked(LongToIntFunctionWithThrowable<E> longtointfunctionwiththrowable) throws E extends Throwable
E
- The type this interface is allowed to throwlongtointfunctionwiththrowable
- The interface instanceE
- the original Exception from longtointfunctionwiththrowableE extends Throwable
static <E extends Throwable> LongToIntFunctionWithThrowable<E> asLongToIntFunctionWithThrowable(LongToIntFunction longtointfunction)
E
- The type this interface is allowed to throwlongtointfunction
- The interface instancedefault int applyAsInt(long v1)
applyAsInt
in interface LongToIntFunction
v1
- parameter to overridden methodint applyAsIntWithThrowable(long v1) throws E extends Throwable
default LongToIntFunction thatReturnsOnCatch(int defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default LongToIntFunction thatUnsafelyThrowsUnchecked() throws E extends Throwable
default LongToIntFunctionWithThrowable<E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault LongToIntFunctionWithThrowable<E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault LongToIntFunctionWithThrowable<E> withLogging()
default LongToIntFunctionWithThrowable<E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.default LongToIntFunctionWithThrowable<E> onException(BiConsumer<Throwable,Object[]> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.