java.lang.Object
io.smallrye.mutiny.unchecked.Unchecked
Provides wrapper to handle functions / consumers / suppliers that throw checked exceptions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,U> BiConsumer <T, U> consumer(UncheckedBiConsumer<T, U> consumer) Transforms the given (unchecked) bi-consumer into a regular bi-consumer.static <T> Consumer<T> consumer(UncheckedConsumer<T> consumer) Transforms the given (unchecked) consumer into a regular consumer.static <T,U, R> BiFunction <T, U, R> function(UncheckedBiFunction<T, U, R> function) Transforms the given (unchecked) bi-function into a regular bi-function.static <T,R> Function <T, R> function(UncheckedFunction<T, R> function) Transforms the given (unchecked) function into a regular function.static <T> Supplier<T> supplier(UncheckedSupplier<T> supplier) Transforms the given (unchecked) supplier into a regular supplier.static <T,U> UncheckedBiConsumer <T, U> unchecked(BiConsumer<T, U> consumer) Transforms the given bi-consumer into a version that can throw exceptions.static <T,U, R> UncheckedBiFunction <T, U, R> unchecked(BiFunction<T, U, R> function) Transforms the given bi-function into a version that can throw exceptions.static <T> UncheckedConsumer<T> Transforms the given consumer into a version that can throw exceptions.static <T,R> UncheckedFunction <T, R> Transforms the given function into a version that can throw exceptions.static <T> UncheckedSupplier<T> Transforms the given supplier into a version that can throw exceptions.
-
Method Details
-
unchecked
Transforms the given bi-function into a version that can throw exceptions.- Type Parameters:
T- the type of the first argument to the functionU- the type of the second argument to the functionR- the type of the result of the function- Parameters:
function- the function- Returns:
- the new
UncheckedBiFunction
-
unchecked
Transforms the given function into a version that can throw exceptions.- Type Parameters:
T- the type of the argument to the functionR- the type of the result of the function- Parameters:
function- the function- Returns:
- the new
UncheckedFunction
-
unchecked
Transforms the given consumer into a version that can throw exceptions.- Type Parameters:
T- the type of the input to the operation- Parameters:
consumer- the consumer- Returns:
- the new
UncheckedConsumer
-
unchecked
Transforms the given bi-consumer into a version that can throw exceptions.- Type Parameters:
T- the type of the first argument to the operationU- the type of the second argument to the operation- Parameters:
consumer- the consumer- Returns:
- the new
UncheckedBiConsumer
-
unchecked
Transforms the given supplier into a version that can throw exceptions.- Type Parameters:
T- the type of items supplied by this supplier- Parameters:
supplier- the supplier- Returns:
- the new
UncheckedSupplier
-
function
Transforms the given (unchecked) function into a regular function. If the operation throws an exception, this exception is rethrown, wrapped into aRuntimeExceptionif needed.- Type Parameters:
T- the type of the argument to the functionR- the type of the result of the function- Parameters:
function- the function- Returns:
- a
Functionexecuting theUncheckedFunction. If the operation throws an exception, the exception is rethrown, wrapped in aRuntimeExceptionif needed.
-
function
Transforms the given (unchecked) bi-function into a regular bi-function. If the operation throws an exception, this exception is rethrown, wrapped into aRuntimeExceptionif needed.- Type Parameters:
T- the type of the first argument to the functionU- the type of the second argument to the functionR- the type of the result of the function- Parameters:
function- the function- Returns:
- a
BiFunctionexecuting thisUncheckedBiFunction. If the operation throws an exception, the exception is rethrown, wrapped in aRuntimeExceptionif needed.
-
consumer
Transforms the given (unchecked) bi-consumer into a regular bi-consumer. If the operation throws an exception, this exception is rethrown, wrapped into aRuntimeExceptionif needed.- Type Parameters:
T- the type of the first argument to the operationU- the type of the second argument to the operation- Parameters:
consumer- the consumer- Returns:
- a
BiConsumerexecuting thisUncheckedBiConsumer. If the operation throws an exception, the exception is rethrown, wrapped in aRuntimeExceptionif needed.
-
consumer
Transforms the given (unchecked) consumer into a regular consumer. If the operation throws an exception, this exception is rethrown, wrapped into aRuntimeExceptionif needed.- Type Parameters:
T- the type of the first argument to the operation- Parameters:
consumer- the consumer- Returns:
- a
Consumerexecuting thisUncheckedConsumer. If the operation throws an exception, the exception is rethrown, wrapped in aRuntimeExceptionif needed.
-
supplier
Transforms the given (unchecked) supplier into a regular supplier. If the operation throws an exception, this exception is rethrown, wrapped into aRuntimeExceptionif needed.- Type Parameters:
T- the type of items supplied by this supplier- Parameters:
supplier- the supplier- Returns:
- a
Supplierexecuting thisUncheckedSupplier. If the operation throws an exception, the exception is rethrown, wrapped in aRuntimeExceptionif needed.
-