T
- some generic flagE
- The extension@FunctionalInterface public interface BinaryOperatorWithThrowable<T,E extends Throwable> extends BinaryOperator<T>
Modifier and Type | Method and Description |
---|---|
static <T,E extends Throwable> |
aBinaryOperatorThatUnsafelyThrowsUnchecked(BinaryOperatorWithThrowable<T,E> binaryoperatorwiththrowable)
Utility method to unwrap lambdas of type BinaryOperator and withUncheckedThrowable any Exception
|
default T |
apply(T v1,
T v2)
Overridden method of BinaryOperatorWithThrowable that will call applyWithThrowable, but catching any exceptions.
|
T |
applyWithThrowable(T v1,
T v2)
Functional method that will throw exceptions.
|
static <T,E extends Throwable> |
asBinaryOperatorWithThrowable(BinaryOperator<T> binaryoperator)
Utility method to convert BinaryOperatorWithThrowable
|
static <T,E extends Throwable> |
castBinaryOperatorWithThrowable(BinaryOperatorWithThrowable<T,E> binaryoperatorwiththrowable)
Utility method to mark lambdas of type BinaryOperatorWithThrowable
|
default BinaryOperatorWithThrowable<T,E> |
onException(BiConsumer<Throwable,Object[]> consumer) |
default BinaryOperatorWithThrowable<T,E> |
onException(Consumer<Throwable> consumer) |
default BinaryOperator<T> |
thatReturnsOnCatch(T defaultReturnValue) |
default BinaryOperator<T> |
thatUnsafelyThrowsUnchecked() |
default BinaryOperatorWithThrowable<T,E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default BinaryOperatorWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default BinaryOperatorWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger,
String message) |
maxBy, minBy
andThen
static <T,E extends Throwable> BinaryOperatorWithThrowable<T,E> castBinaryOperatorWithThrowable(BinaryOperatorWithThrowable<T,E> binaryoperatorwiththrowable)
T
- Generic that corresponds to the same generic on BinaryOperatorE
- The type this interface is allowed to throwbinaryoperatorwiththrowable
- The interface instancestatic <T,E extends Throwable> BinaryOperator<T> aBinaryOperatorThatUnsafelyThrowsUnchecked(BinaryOperatorWithThrowable<T,E> binaryoperatorwiththrowable) throws E extends Throwable
T
- Generic that corresponds to the same generic on BinaryOperatorE
- The type this interface is allowed to throwbinaryoperatorwiththrowable
- The interface instanceE
- the original Exception from binaryoperatorwiththrowableE extends Throwable
static <T,E extends Throwable> BinaryOperatorWithThrowable<T,E> asBinaryOperatorWithThrowable(BinaryOperator<T> binaryoperator)
T
- Generic that corresponds to the same generic on BinaryOperatorE
- The type this interface is allowed to throwbinaryoperator
- The interface instancedefault T apply(T v1, T v2)
apply
in interface BiFunction<T,T,T>
v1
- parameter to overridden methodv2
- parameter to overridden methodT applyWithThrowable(T v1, T v2) throws E extends Throwable
default BinaryOperator<T> thatReturnsOnCatch(T defaultReturnValue)
defaultReturnValue
- A value to return if any throwable is caught.default BinaryOperator<T> thatUnsafelyThrowsUnchecked() throws E extends Throwable
default BinaryOperatorWithThrowable<T,E> withLogging(org.slf4j.Logger logger, String message)
logger
- The logger to log exceptions onmessage
- A message to use for logging exceptionsdefault BinaryOperatorWithThrowable<T,E> withLogging(org.slf4j.Logger logger)
logger
- The logger instance to log exceptions ondefault BinaryOperatorWithThrowable<T,E> withLogging()
default BinaryOperatorWithThrowable<T,E> onException(Consumer<Throwable> consumer)
consumer
- An exception consumer.default BinaryOperatorWithThrowable<T,E> onException(BiConsumer<Throwable,Object[]> consumer)
consumer
- An exception consumer.Copyright © 2017. All rights reserved.