T - some generic flagE - The extension@FunctionalInterface public interface UnaryOperatorWithThrowable<T,E extends Throwable> extends UnaryOperator<T>
| Modifier and Type | Method and Description |
|---|---|
default T |
apply(T v1)
Overridden method of UnaryOperatorWithThrowable that will call applyWithThrowable, but catching any exceptions.
|
T |
applyWithThrowable(T v1)
Functional method that will throw exceptions.
|
static <T,E extends Throwable> |
asUnaryOperatorWithThrowable(UnaryOperator<T> unaryoperator)
Utility method to convert UnaryOperatorWithThrowable
|
static <T,E extends Throwable> |
aUnaryOperatorThatUnsafelyThrowsUnchecked(UnaryOperatorWithThrowable<T,E> unaryoperatorwiththrowable)
Utility method to unwrap lambdas of type UnaryOperator and withUncheckedThrowable any Exception
|
static <T,E extends Throwable> |
castUnaryOperatorWithThrowable(UnaryOperatorWithThrowable<T,E> unaryoperatorwiththrowable)
Utility method to mark lambdas of type UnaryOperatorWithThrowable
|
default UnaryOperatorWithThrowable<T,E> |
onException(BiConsumer<Throwable,Object[]> consumer) |
default UnaryOperatorWithThrowable<T,E> |
onException(Consumer<Throwable> consumer) |
default UnaryOperator<T> |
thatReturnsOnCatch(T defaultReturnValue) |
default UnaryOperator<T> |
thatUnsafelyThrowsUnchecked() |
default UnaryOperatorWithThrowable<T,E> |
withLogging()
Will log WARNING level exceptions on logger if they occur within the interface
|
default UnaryOperatorWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger)
Will log WARNING level exceptions on logger if they occur within the interface
|
default UnaryOperatorWithThrowable<T,E> |
withLogging(org.slf4j.Logger logger,
String message) |
identitystatic <T,E extends Throwable> UnaryOperatorWithThrowable<T,E> castUnaryOperatorWithThrowable(UnaryOperatorWithThrowable<T,E> unaryoperatorwiththrowable)
T - Generic that corresponds to the same generic on UnaryOperatorE - The type this interface is allowed to throwunaryoperatorwiththrowable - The interface instancestatic <T,E extends Throwable> UnaryOperator<T> aUnaryOperatorThatUnsafelyThrowsUnchecked(UnaryOperatorWithThrowable<T,E> unaryoperatorwiththrowable) throws E extends Throwable
T - Generic that corresponds to the same generic on UnaryOperatorE - The type this interface is allowed to throwunaryoperatorwiththrowable - The interface instanceE - the original Exception from unaryoperatorwiththrowableE extends Throwablestatic <T,E extends Throwable> UnaryOperatorWithThrowable<T,E> asUnaryOperatorWithThrowable(UnaryOperator<T> unaryoperator)
T - Generic that corresponds to the same generic on UnaryOperatorE - The type this interface is allowed to throwunaryoperator - The interface instancedefault T apply(T v1)
T applyWithThrowable(T v1) throws E extends Throwable
default UnaryOperator<T> thatReturnsOnCatch(T defaultReturnValue)
defaultReturnValue - A value to return if any throwable is caught.default UnaryOperator<T> thatUnsafelyThrowsUnchecked() throws E extends Throwable
default UnaryOperatorWithThrowable<T,E> withLogging(org.slf4j.Logger logger, String message)
logger - The logger to log exceptions onmessage - A message to use for logging exceptionsdefault UnaryOperatorWithThrowable<T,E> withLogging(org.slf4j.Logger logger)
logger - The logger instance to log exceptions ondefault UnaryOperatorWithThrowable<T,E> withLogging()
default UnaryOperatorWithThrowable<T,E> onException(Consumer<Throwable> consumer)
consumer - An exception consumer.default UnaryOperatorWithThrowable<T,E> onException(BiConsumer<Throwable,Object[]> consumer)
consumer - An exception consumer.Copyright © 2017. All rights reserved.