T
- some generic flagE
- The extension@FunctionalInterface public interface ToIntFunctionWithThrowable<T,E extends Throwable> extends ToIntFunction<T>
Modifier and Type | Method and Description |
---|---|
default int |
applyAsInt(T v1)
Overridden method of ToIntFunctionWithThrowable that will call applyAsIntWithThrowable, but catching any exceptions.
|
int |
applyAsIntWithThrowable(T v1)
Functional method that will throw exceptions.
|
static <T,E extends Throwable> |
asToIntFunctionWithThrowable(ToIntFunction<T> tointfunction)
Utility method to convert ToIntFunctionWithThrowable
|
static <T,E extends Throwable> |
aToIntFunctionThatUnsafelyThrowsUnchecked(ToIntFunctionWithThrowable<T,E> tointfunctionwiththrowable)
Utility method to unwrap lambdas of type ToIntFunction and withUncheckedThrowable any Exception
|
static <T,E extends Throwable> |
castToIntFunctionWithThrowable(ToIntFunctionWithThrowable<T,E> tointfunctionwiththrowable)
Utility method to mark lambdas of type ToIntFunctionWithThrowable
|
default ToIntFunctionWithThrowable<T,E> |
onException(BiConsumer<Throwable,Object[]> consumer) |
default ToIntFunctionWithThrowable<T,E> |
onException(Consumer<Throwable> consumer) |
default ToIntFunction<T> |
thatReturnsOnCatch(int defaultReturnValue) |
default Function<T,OptionalInt> |
thatReturnsOptional() |
default ToIntFunction<T> |
thatUnsafelyThrowsUnchecked() |
default ToIntFunctionWithThrowable<T,E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default ToIntFunctionWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default ToIntFunctionWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger,
String message) |
static <T,E extends Throwable> ToIntFunctionWithThrowable<T,E> castToIntFunctionWithThrowable(ToIntFunctionWithThrowable<T,E> tointfunctionwiththrowable)
T
- Generic that corresponds to the same generic on ToIntFunctionE
- The type this interface is allowed to throwtointfunctionwiththrowable
- The interface instancestatic <T,E extends Throwable> ToIntFunction<T> aToIntFunctionThatUnsafelyThrowsUnchecked(ToIntFunctionWithThrowable<T,E> tointfunctionwiththrowable) throws E extends Throwable
T
- Generic that corresponds to the same generic on ToIntFunctionE
- The type this interface is allowed to throwtointfunctionwiththrowable
- The interface instanceE
- the original Exception from tointfunctionwiththrowableE extends Throwable
static <T,E extends Throwable> ToIntFunctionWithThrowable<T,E> asToIntFunctionWithThrowable(ToIntFunction<T> tointfunction)
T
- Generic that corresponds to the same generic on ToIntFunctionE
- The type this interface is allowed to throwtointfunction
- The interface instancedefault int applyAsInt(T v1)
applyAsInt
in interface ToIntFunction<T>
v1
- parameter to overridden methodint applyAsIntWithThrowable(T v1) throws E extends Throwable
default Function<T,OptionalInt> thatReturnsOptional()
default ToIntFunction<T> thatReturnsOnCatch(int defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default ToIntFunction<T> thatUnsafelyThrowsUnchecked() throws E extends Throwable
default ToIntFunctionWithThrowable<T,E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault ToIntFunctionWithThrowable<T,E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault ToIntFunctionWithThrowable<T,E> withLogging()
default ToIntFunctionWithThrowable<T,E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.default ToIntFunctionWithThrowable<T,E> onException(BiConsumer<Throwable,Object[]> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.