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