public final class LambdaExceptionUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
LambdaExceptionUtils.BiConsumerWithExceptions<T,U,E extends Exception>
Represents a
BiConsumer interface which can throw exceptions. |
static interface |
LambdaExceptionUtils.BiFunctionWithExceptions<T,U,R,E extends Exception>
Represents a
BiFunction interface which can throw exceptions. |
static interface |
LambdaExceptionUtils.ConsumerWithExceptions<T,E extends Exception>
Represents a
Consumer interface which can throw exceptions. |
static interface |
LambdaExceptionUtils.FunctionWithExceptions<T,R,E extends Exception>
Represents a
Function interface which can throw exceptions. |
static interface |
LambdaExceptionUtils.RunnableWithExceptions<E extends Exception>
Represents a
Runnable interface which can throw exceptions. |
static interface |
LambdaExceptionUtils.SupplierWithExceptions<T,E extends Exception>
Represents a
Supplier interface which can throw exceptions. |
static interface |
LambdaExceptionUtils.TriConsumer<T,U,V>
Represents a
TriConsumer interface. |
static interface |
LambdaExceptionUtils.TriConsumerWithExceptions<T,U,V,E extends Exception>
Represents a
BiConsumer interface which can throw exceptions. |
Constructor and Description |
---|
LambdaExceptionUtils() |
Modifier and Type | Method and Description |
---|---|
static <T,U,E extends Exception> |
rethrowBiConsumer(LambdaExceptionUtils.BiConsumerWithExceptions<T,U,E> biConsumer)
This method allows a BiConsumer which throws exceptions to be used in places which expects a BiConsumer.
|
static <T,E extends Exception> |
rethrowConsumer(LambdaExceptionUtils.ConsumerWithExceptions<T,E> consumer)
This method allows a Consumer which throws exceptions to be used in places which expects a Consumer.
|
static <T,U,R,E extends Exception> |
rethrowFunction(LambdaExceptionUtils.BiFunctionWithExceptions<T,U,R,E> biFunction)
This method allows a BiFunction which throws exceptions to be used in places which expects a BiFunction.
|
static <T,R,E extends Exception> |
rethrowFunction(LambdaExceptionUtils.FunctionWithExceptions<T,R,E> function)
This method allows a Function which throws exceptions to be used in places which expects a Function.
|
static <T,E extends Exception> |
rethrowSupplier(LambdaExceptionUtils.SupplierWithExceptions<T,E> function)
This method allows a Supplier which throws exceptions to be used in places which expects a Supplier.
|
public static <T,E extends Exception> Consumer<T> rethrowConsumer(LambdaExceptionUtils.ConsumerWithExceptions<T,E> consumer)
T
- the type of the input to the functionE
- the type of Exceptionconsumer
- instances of the ConsumerWithExceptions
functional interfaceConsumer
public static <T,U,E extends Exception> BiConsumer<T,U> rethrowBiConsumer(LambdaExceptionUtils.BiConsumerWithExceptions<T,U,E> biConsumer)
T
- the type of the input to the functionU
- the type of the input to the functionE
- the type of ExceptionbiConsumer
- instances of the BiConsumerWithExceptions
functional interfaceBiConsumer
public static <T,R,E extends Exception> Function<T,R> rethrowFunction(LambdaExceptionUtils.FunctionWithExceptions<T,R,E> function)
T
- Any Object.R
- Any ObjectE
- Any Exception.function
- Function to apply for given arguments.public static <T,U,R,E extends Exception> BiFunction<T,U,R> rethrowFunction(LambdaExceptionUtils.BiFunctionWithExceptions<T,U,R,E> biFunction)
T
- Any Object.U
- Any Object.R
- Any Object.E
- Any Exception.biFunction
- BiFunction to apply for given arguments.public static <T,E extends Exception> Supplier<T> rethrowSupplier(LambdaExceptionUtils.SupplierWithExceptions<T,E> function)
T
- Any Object.E
- Any Exception.function
- Function to apply for given arguments.Copyright © 2019 WSO2. All rights reserved.