java.lang.Object
io.smallrye.common.function.Functions
A set of utility methods which return common functions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,U> Runnable capturingRunnable(BiConsumer<T, U> consumer, T param1, U param2) Get a runnable which executes the given consumer with captured values.static <T> RunnablecapturingRunnable(Consumer<T> consumer, T param) Get a runnable which executes the given consumer with captured values.static <T,E extends EE, TT extends T, U, UU extends U, EE extends Exception>
ExceptionBiConsumer<TT, UU, EE> cast(ExceptionBiConsumer<T, U, E> consumer) Returns aExceptionBiConsumerwith identical behavior to the specifiedExceptionBiConsumerbut with restricted parameter types and relaxed exception type.static <T,U, R extends RR, E extends EE, TT extends T, UU extends U, RR, EE extends Exception>
ExceptionBiFunction<TT, UU, RR, EE> cast(ExceptionBiFunction<T, U, R, E> function) Returns aExceptionBiFunctionwith identical behavior to the specifiedExceptionBiFunctionbut with restricted parameter types, relaxed return type, and relaxed exception type.static <T,U, E extends EE, TT extends T, UU extends U, EE extends Exception>
ExceptionBiPredicate<TT, UU, EE> cast(ExceptionBiPredicate<T, U, E> predicate) Returns aExceptionBiPredicatewith identical behavior to the specifiedExceptionBiPredicatebut with restricted parameter types and relaxed exception type.static <T,E extends EE, TT extends T, EE extends Exception>
ExceptionConsumer<TT, EE> cast(ExceptionConsumer<T, E> consumer) Returns aExceptionConsumerwith identical behavior to the specifiedExceptionConsumerbut with restricted parameter type and relaxed exception type.static <T,R extends RR, E extends EE, TT extends T, RR, EE extends Exception>
ExceptionFunction<TT, RR, EE> cast(ExceptionFunction<T, R, E> function) Returns aExceptionFunctionwith identical behavior to the specifiedExceptionFunctionbut with restricted parameter type, relaxed return type, and relaxed exception type.static <R extends RR,E extends EE, RR, EE extends Exception>
ExceptionIntFunction<RR, EE> cast(ExceptionIntFunction<R, E> function) Returns aExceptionIntFunctionwith identical behavior to the specifiedExceptionFunctionbut with relaxed return type and relaxed exception type.static <R extends RR,E extends EE, RR, EE extends Exception>
ExceptionLongFunction<RR, EE> cast(ExceptionLongFunction<R, E> function) Returns aExceptionLongFunctionwith identical behavior to the specifiedExceptionLongFunctionbut with relaxed return type and relaxed exception type.static <T,E extends EE, TT extends T, EE extends Exception>
ExceptionObjIntConsumer<TT, EE> cast(ExceptionObjIntConsumer<T, E> consumer) Returns aExceptionObjIntConsumerwith identical behavior to the specifiedExceptionObjIntConsumerbut with restricted parameter type and relaxed exception type.static <T,E extends EE, TT extends T, EE extends Exception>
ExceptionObjLongConsumer<TT, EE> cast(ExceptionObjLongConsumer<T, E> consumer) Returns aExceptionObjLongConsumerwith identical behavior to the specifiedExceptionObjLongConsumerbut with restricted parameter type and relaxed exception type.static <T,E extends EE, TT extends T, EE extends Exception>
ExceptionPredicate<TT, EE> cast(ExceptionPredicate<T, E> consumer) Returns aExceptionPredicatewith identical behavior to the specifiedExceptionPredicatebut with restricted parameter type and relaxed exception type.static <T extends TT,E extends EE, TT, EE extends Exception>
ExceptionSupplier<TT, EE> cast(ExceptionSupplier<T, E> supplier) Returns aExceptionSupplierwith identical behavior to the specifiedExceptionSupplierbut with relaxed return type and relaxed exception type.static <T,U, E extends EE, TT extends T, UU extends U, EE extends Exception>
ExceptionToIntBiFunction<TT, UU, EE> cast(ExceptionToIntBiFunction<T, U, E> function) Returns aExceptionToIntBiFunctionwith identical behavior to the specifiedExceptionToIntBiFunctionbut with restricted parameter types and relaxed exception type.static <T,E extends EE, TT extends T, EE extends Exception>
ExceptionToIntFunction<TT, EE> cast(ExceptionToIntFunction<T, E> function) Returns aExceptionToIntFunctionwith identical behavior to the specifiedExceptionToIntFunctionbut with restricted parameter type and relaxed exception type.static <T,U, E extends EE, TT extends T, UU extends U, EE extends Exception>
ExceptionToLongBiFunction<TT, UU, EE> cast(ExceptionToLongBiFunction<T, U, E> function) Returns aExceptionToLongBiFunctionwith identical behavior to the specifiedExceptionToLongBiFunctionbut with restricted parameter types and relaxed exception type.static <T,E extends EE, TT extends T, EE extends Exception>
ExceptionToLongFunction<TT, EE> cast(ExceptionToLongFunction<T, E> function) Returns aExceptionToLongFunctionwith identical behavior to the specifiedExceptionToLongFunctionbut with restricted parameter type and relaxed exception type.static <T,U, TT extends T, UU extends U>
BiConsumer<TT, UU> cast(BiConsumer<T, U> consumer) Returns aBiConsumerwith identical behavior to the specifiedBiConsumerbut with restricted parameter types.static <T,U, R extends RR, TT extends T, UU extends U, RR>
BiFunction<TT, UU, RR> cast(BiFunction<T, U, R> function) Returns aBiFunctionwith identical behavior to the specifiedBiFunctionbut with restricted parameter types and relaxed return type.static <T,U, TT extends T, UU extends U>
BiPredicate<TT, UU> cast(BiPredicate<T, U> predicate) Returns aBiPredicatewith identical behavior to the specifiedBiPredicatebut with restricted parameter types.static <T,TT extends T>
Consumer<TT> static <R extends RR,RR>
DoubleFunction<RR> cast(DoubleFunction<R> function) Returns aDoubleFunctionwith identical behavior to the specifiedDoubleFunctionbut with relaxed return type.static <T,R extends RR, TT extends T, RR>
Function<TT, RR> static <R extends RR,RR>
IntFunction<RR> cast(IntFunction<R> function) Returns aIntFunctionwith identical behavior to the specifiedIntFunctionbut with relaxed return type.static <R extends RR,RR>
LongFunction<RR> cast(LongFunction<R> function) Returns aLongFunctionwith identical behavior to the specifiedLongFunctionbut with relaxed return type.static <T,TT extends T>
ObjDoubleConsumer<TT> cast(ObjDoubleConsumer<T> consumer) Returns aObjDoubleConsumerwith identical behavior to the specifiedObjDoubleConsumerbut with restricted parameter type.static <T,TT extends T>
ObjIntConsumer<TT> cast(ObjIntConsumer<T> consumer) Returns aObjIntConsumerwith identical behavior to the specifiedObjIntConsumerbut with restricted parameter type.static <T,TT extends T>
ObjLongConsumer<TT> cast(ObjLongConsumer<T> consumer) Returns aObjLongConsumerwith identical behavior to the specifiedObjLongConsumerbut with restricted parameter type.static <T,TT extends T>
Predicate<TT> static <T extends TT,TT>
Supplier<TT> static <T,U, TT extends T, UU extends U>
ToDoubleBiFunction<TT, UU> cast(ToDoubleBiFunction<T, U> function) Returns aToDoubleBiFunctionwith identical behavior to the specifiedToDoubleBiFunctionbut with restricted parameter types.static <T,TT extends T>
ToDoubleFunction<TT> cast(ToDoubleFunction<T> function) Returns aToDoubleFunctionwith identical behavior to the specifiedToDoubleFunctionbut with restricted parameter type.static <T,U, TT extends T, UU extends U>
ToIntBiFunction<TT, UU> cast(ToIntBiFunction<T, U> function) Returns aToIntBiFunctionwith identical behavior to the specifiedToIntBiFunctionbut with restricted parameter types.static <T,TT extends T>
ToIntFunction<TT> cast(ToIntFunction<T> function) Returns aToIntFunctionwith identical behavior to the specifiedToIntFunctionbut with restricted parameter type.static <T,U, TT extends T, UU extends U>
ToLongBiFunction<TT, UU> cast(ToLongBiFunction<T, U> function) Returns aToLongBiFunctionwith identical behavior to the specifiedToLongBiFunctionbut with restricted parameter types.static <T,TT extends T>
ToLongFunction<TT> cast(ToLongFunction<T> function) Returns aToLongFunctionwith identical behavior to the specifiedToLongFunctionbut with restricted parameter type.static <T extends AutoCloseable>
Consumer<T> Returns a consumer that quietly closes its argument, logging any exceptions.static <T,E extends Exception>
ExceptionSupplier<T, E> constantExceptionSupplier(T value) Get a supplier which always returns the same value.static <T> Supplier<T> constantSupplier(T value) Get a supplier which always returns the same value.static <T> BiConsumer<Consumer<T>, T> Get the singleton consumer which accepts a consumer and an argument to hand to it.static <T> ExceptionBiConsumer<Consumer<T>, T, RuntimeException> Get the singleton consumer which accepts a consumer and an argument to hand to it.static <T,U> BiConsumer <T, U> Get a consumer which discards the values it is given.static <T> Consumer<T> Get a consumer which discards the values it is given.static <T,U, E extends Exception>
ExceptionBiConsumer<T, U, E> Get a consumer which discards the values it is given.static <T,E extends Exception>
ExceptionConsumer<T, E> Get a consumer which discards the values it is given.static <T,U, E extends Exception>
ExceptionRunnable<E> exceptionCapturingRunnable(ExceptionBiConsumer<T, U, E> consumer, T param1, U param2) Get a runnable which executes the given consumer with captured values.static <T,E extends Exception>
ExceptionRunnable<E> exceptionCapturingRunnable(ExceptionConsumer<T, E> consumer, T param) Get a runnable which executes the given consumer with captured values.static <T,E extends Exception>
ExceptionBiConsumer<ExceptionConsumer<T, E>, T, E> Get the singleton consumer which accepts a consumer and an argument to hand to it.static <T,R, E extends Exception>
ExceptionBiFunction<ExceptionFunction<T, R, E>, T, R, E> Get the singleton function which accepts a function and a parameter to pass to the function, and returns the result of the function.Returns a consumer that logs its exception parameter as a warning.static <E extends Exception>
ExceptionConsumer<ExceptionRunnable<E>, E> Get the singleton exception consumer which accepts and runs exception runnable instances.static <R,E extends Exception>
ExceptionFunction<ExceptionSupplier<R, E>, R, E> Get the singleton function which accepts a supplier and returns the result of the supplier.static <R,E extends Exception>
ExceptionBiFunction<ExceptionFunction<ExceptionSupplier<R, E>, R, E>, ExceptionSupplier<R, E>, R, E> Get the singleton function which accepts a function which accepts a supplier, all of which return the result of the supplier.static <T,R> BiFunction <Function<T, R>, T, R> Get the singleton function which accepts a function and a parameter to pass to the function, and returns the result of the function.static <T,R> ExceptionBiFunction <Function<T, R>, T, R, RuntimeException> Get the singleton function which accepts a function and a parameter to pass to the function, and returns the result of the function.static <T,U, E extends Exception>
BiConsumer<T, U> quiet(ExceptionBiConsumer<T, U, E> consumer, Consumer<E> handler) Converts anExceptionBiConsumerto a standardBiConsumerusing the specified exception handler.quiet(ExceptionConsumer<T, E> consumer, Consumer<E> handler) Converts anExceptionConsumerto a standardConsumerusing the specified exception handler.static <T,E extends Exception>
ObjIntConsumer<T> quiet(ExceptionObjIntConsumer<T, E> consumer, Consumer<E> handler) Converts anExceptionObjIntConsumerto a standardObjIntConsumerusing the specified exception handler.static <T,E extends Exception>
ObjLongConsumer<T> quiet(ExceptionObjLongConsumer<T, E> consumer, Consumer<E> handler) Converts anExceptionObjLongConsumerto a standardObjLongConsumerusing the specified exception handler.Get the singleton consumer which accepts and runs runnable instances.Get the singleton exception consumer which accepts and runs runnable instances.static <E extends Exception,RE extends RuntimeException>
Consumer<E> runtimeExceptionThrowingConsumer(Function<E, RE> wrapper) Returns a consumer that wraps and throws its exception parameter as aRuntimeException.static <R> ExceptionFunction<Supplier<R>, R, RuntimeException> Get the singleton function which accepts a supplier and returns the result of the supplier.Get the singleton function which accepts a supplier and returns the result of the supplier.static <R> BiFunction<Function<Supplier<R>, R>, Supplier<R>, R> Get the singleton function which accepts a function which accepts a supplier, all of which return the result of the supplier.
-
Method Details
-
runnableConsumer
Get the singleton consumer which accepts and runs runnable instances.- Returns:
- the runnable consumer
-
exceptionRunnableConsumer
public static <E extends Exception> ExceptionConsumer<ExceptionRunnable<E>,E> exceptionRunnableConsumer()Get the singleton exception consumer which accepts and runs exception runnable instances.- Type Parameters:
E- the exception type- Returns:
- the runnable consumer
-
runnableExceptionConsumer
Get the singleton exception consumer which accepts and runs runnable instances.- Returns:
- the runnable consumer
-
consumerBiConsumer
Get the singleton consumer which accepts a consumer and an argument to hand to it.- Type Parameters:
T- the argument type- Returns:
- the consumer
-
exceptionConsumerBiConsumer
public static <T,E extends Exception> ExceptionBiConsumer<ExceptionConsumer<T,E>, exceptionConsumerBiConsumer()T, E> Get the singleton consumer which accepts a consumer and an argument to hand to it.- Type Parameters:
T- the argument typeE- the exception type- Returns:
- the consumer
-
consumerExceptionBiConsumer
Get the singleton consumer which accepts a consumer and an argument to hand to it.- Type Parameters:
T- the argument type- Returns:
- the consumer
-
supplierFunction
Get the singleton function which accepts a supplier and returns the result of the supplier.- Type Parameters:
R- the result type- Returns:
- the function
-
exceptionSupplierFunction
public static <R,E extends Exception> ExceptionFunction<ExceptionSupplier<R,E>, exceptionSupplierFunction()R, E> Get the singleton function which accepts a supplier and returns the result of the supplier.- Type Parameters:
R- the result typeE- the exception type- Returns:
- the function
-
supplierExceptionFunction
Get the singleton function which accepts a supplier and returns the result of the supplier.- Type Parameters:
R- the result type- Returns:
- the function
-
supplierFunctionBiFunction
Get the singleton function which accepts a function which accepts a supplier, all of which return the result of the supplier.- Type Parameters:
R- the result type- Returns:
- the function
-
exceptionSupplierFunctionBiFunction
public static <R,E extends Exception> ExceptionBiFunction<ExceptionFunction<ExceptionSupplier<R,E>, exceptionSupplierFunctionBiFunction()R, E>, ExceptionSupplier<R, E>, R, E> Get the singleton function which accepts a function which accepts a supplier, all of which return the result of the supplier.- Type Parameters:
R- the result typeE- the exception type- Returns:
- the function
-
functionBiFunction
Get the singleton function which accepts a function and a parameter to pass to the function, and returns the result of the function.- Type Parameters:
T- the argument typeR- the result type- Returns:
- the function
-
exceptionFunctionBiFunction
public static <T,R, ExceptionBiFunction<ExceptionFunction<T,E extends Exception> R, exceptionFunctionBiFunction()E>, T, R, E> Get the singleton function which accepts a function and a parameter to pass to the function, and returns the result of the function.- Type Parameters:
T- the argument typeR- the result typeE- the exception type- Returns:
- the function
-
functionExceptionBiFunction
public static <T,R> ExceptionBiFunction<Function<T,R>, functionExceptionBiFunction()T, R, RuntimeException> Get the singleton function which accepts a function and a parameter to pass to the function, and returns the result of the function.- Type Parameters:
T- the argument typeR- the result type- Returns:
- the function
-
constantSupplier
Get a supplier which always returns the same value.- Type Parameters:
T- the value type- Parameters:
value- the value to return- Returns:
- the value supplier
-
constantExceptionSupplier
Get a supplier which always returns the same value.- Type Parameters:
T- the value typeE- the exception type- Parameters:
value- the value to return- Returns:
- the value supplier
-
capturingRunnable
Get a runnable which executes the given consumer with captured values.- Type Parameters:
T- the first parameter typeU- the second parameter type- Parameters:
consumer- the consumer to run (must not benull)param1- the first parameter to passparam2- the second parameter to pass- Returns:
- the capturing runnable
-
capturingRunnable
Get a runnable which executes the given consumer with captured values.- Type Parameters:
T- the parameter type- Parameters:
consumer- the consumer to run (must not benull)param- the parameter to pass- Returns:
- the capturing runnable
-
exceptionCapturingRunnable
public static <T,U, ExceptionRunnable<E> exceptionCapturingRunnableE extends Exception> (ExceptionBiConsumer<T, U, E> consumer, T param1, U param2) Get a runnable which executes the given consumer with captured values.- Type Parameters:
T- the first parameter typeU- the second parameter typeE- the exception type- Parameters:
consumer- the consumer to run (must not benull)param1- the first parameter to passparam2- the second parameter to pass- Returns:
- the capturing runnable
-
exceptionCapturingRunnable
public static <T,E extends Exception> ExceptionRunnable<E> exceptionCapturingRunnable(ExceptionConsumer<T, E> consumer, T param) Get a runnable which executes the given consumer with captured values.- Type Parameters:
T- the parameter typeE- the exception type- Parameters:
consumer- the consumer to run (must not benull)param- the parameter to pass- Returns:
- the capturing runnable
-
discardingConsumer
Get a consumer which discards the values it is given.- Type Parameters:
T- the parameter type- Returns:
- the discarding consumer
-
discardingExceptionConsumer
Get a consumer which discards the values it is given.- Type Parameters:
T- the parameter typeE- the exception type- Returns:
- the discarding consumer
-
discardingBiConsumer
Get a consumer which discards the values it is given.- Type Parameters:
T- the first parameter typeU- the second parameter type- Returns:
- the discarding consumer
-
discardingExceptionBiConsumer
public static <T,U, ExceptionBiConsumer<T,E extends Exception> U, discardingExceptionBiConsumer()E> Get a consumer which discards the values it is given.- Type Parameters:
T- the first parameter typeU- the second parameter typeE- the exception type- Returns:
- the discarding consumer
-
closingConsumer
Returns a consumer that quietly closes its argument, logging any exceptions.- Type Parameters:
T- the closeable type- Returns:
- a closing consumer
-
exceptionLoggingConsumer
Returns a consumer that logs its exception parameter as a warning.- Type Parameters:
E- the exception type- Returns:
- an exception consumer
-
runtimeExceptionThrowingConsumer
public static <E extends Exception,RE extends RuntimeException> Consumer<E> runtimeExceptionThrowingConsumer(Function<E, RE> wrapper) Returns a consumer that wraps and throws its exception parameter as aRuntimeException.- Type Parameters:
E- the exception typeRE- the runtime exception type- Parameters:
wrapper- a runtime exception wrapper- Returns:
- an exception consumer
-
quiet
public static <T,E extends Exception> Consumer<T> quiet(ExceptionConsumer<T, E> consumer, Consumer<E> handler) Converts anExceptionConsumerto a standardConsumerusing the specified exception handler.- Type Parameters:
T- the parameter type of the consumerE- the exception type- Parameters:
consumer- an exception consumerhandler- an exception handler- Returns:
- a standard consumer
-
quiet
public static <T,U, BiConsumer<T,E extends Exception> U> quiet(ExceptionBiConsumer<T, U, E> consumer, Consumer<E> handler) Converts anExceptionBiConsumerto a standardBiConsumerusing the specified exception handler.- Type Parameters:
T- the first parameter type of the consumerU- the second parameter type of the consumerE- the exception type- Parameters:
consumer- a binary exception consumerhandler- an exception handler- Returns:
- a standard binary consumer
-
quiet
public static <T,E extends Exception> ObjIntConsumer<T> quiet(ExceptionObjIntConsumer<T, E> consumer, Consumer<E> handler) Converts anExceptionObjIntConsumerto a standardObjIntConsumerusing the specified exception handler.- Type Parameters:
T- the first parameter type of the consumerE- the exception type- Parameters:
consumer- an object/int exception consumerhandler- an exception handler- Returns:
- a standard object/int consumer
-
quiet
public static <T,E extends Exception> ObjLongConsumer<T> quiet(ExceptionObjLongConsumer<T, E> consumer, Consumer<E> handler) Converts anExceptionObjLongConsumerto a standardObjLongConsumerusing the specified exception handler.- Type Parameters:
T- the first parameter type of the consumerE- the exception type- Parameters:
consumer- an object/long exception consumerhandler- an exception handler- Returns:
- a standard object/long consumer
-
cast
Returns aConsumerwith identical behavior to the specifiedConsumerbut with restricted parameter type.- Type Parameters:
T- the parameter typeTT- the restricted parameter type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
Returns aPredicatewith identical behavior to the specifiedPredicatebut with restricted parameter type.- Type Parameters:
T- the parameter typeTT- the restricted parameter type- Parameters:
predicate- a predicate- Returns:
- a functionally equivalent predicate
-
cast
- Type Parameters:
T- the return typeTT- the relaxed return type- Parameters:
supplier- a supplier- Returns:
- a functionally equivalent supplier
-
cast
Returns aFunctionwith identical behavior to the specifiedFunctionbut with restricted parameter type and relaxed return type.- Type Parameters:
T- the parameter typeR- the return typeTT- the restricted parameter typeRR- the relaxed return type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
Returns aDoubleFunctionwith identical behavior to the specifiedDoubleFunctionbut with relaxed return type.- Type Parameters:
R- the return typeRR- the relaxed return type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
Returns aIntFunctionwith identical behavior to the specifiedIntFunctionbut with relaxed return type.- Type Parameters:
R- the return typeRR- the relaxed return type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
Returns aLongFunctionwith identical behavior to the specifiedLongFunctionbut with relaxed return type.- Type Parameters:
R- the return typeRR- the relaxed return type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
Returns aToDoubleFunctionwith identical behavior to the specifiedToDoubleFunctionbut with restricted parameter type.- Type Parameters:
T- the parameter typeTT- the restricted parameter type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
Returns aToIntFunctionwith identical behavior to the specifiedToIntFunctionbut with restricted parameter type.- Type Parameters:
T- the parameter typeTT- the restricted parameter type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
Returns aToLongFunctionwith identical behavior to the specifiedToLongFunctionbut with restricted parameter type.- Type Parameters:
T- the parameter typeTT- the restricted parameter type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
Returns aBiConsumerwith identical behavior to the specifiedBiConsumerbut with restricted parameter types.- Type Parameters:
T- the first parameter typeU- the second parameter typeTT- the restricted first parameter typeUU- the restricted second parameter type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
Returns aObjDoubleConsumerwith identical behavior to the specifiedObjDoubleConsumerbut with restricted parameter type.- Type Parameters:
T- the parameter typeTT- the restricted parameter type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
Returns aObjIntConsumerwith identical behavior to the specifiedObjIntConsumerbut with restricted parameter type.- Type Parameters:
T- the parameter typeTT- the restricted parameter type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
Returns aObjLongConsumerwith identical behavior to the specifiedObjLongConsumerbut with restricted parameter type.- Type Parameters:
T- the parameter typeTT- the restricted parameter type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
public static <T,U, BiPredicate<TT,TT extends T, UU extends U> UU> cast(BiPredicate<T, U> predicate) Returns aBiPredicatewith identical behavior to the specifiedBiPredicatebut with restricted parameter types.- Type Parameters:
T- the first parameter typeU- the second parameter typeTT- the restricted first parameter typeUU- the restricted second parameter type- Parameters:
predicate- a predicate- Returns:
- a functionally equivalent predicate
-
cast
public static <T,U, BiFunction<TT,R extends RR, TT extends T, UU extends U, RR> UU, castRR> (BiFunction<T, U, R> function) Returns aBiFunctionwith identical behavior to the specifiedBiFunctionbut with restricted parameter types and relaxed return type.- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the return typeTT- the restricted first parameter typeUU- the restricted second parameter typeRR- the relaxed return type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,U, ToDoubleBiFunction<TT,TT extends T, UU extends U> UU> cast(ToDoubleBiFunction<T, U> function) Returns aToDoubleBiFunctionwith identical behavior to the specifiedToDoubleBiFunctionbut with restricted parameter types.- Type Parameters:
T- the first parameter typeU- the second parameter typeTT- the restricted first parameter typeUU- the restricted second parameter type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,U, ToIntBiFunction<TT,TT extends T, UU extends U> UU> cast(ToIntBiFunction<T, U> function) Returns aToIntBiFunctionwith identical behavior to the specifiedToIntBiFunctionbut with restricted parameter types.- Type Parameters:
T- the first parameter typeU- the second parameter typeTT- the restricted first parameter typeUU- the restricted second parameter type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,U, ToLongBiFunction<TT,TT extends T, UU extends U> UU> cast(ToLongBiFunction<T, U> function) Returns aToLongBiFunctionwith identical behavior to the specifiedToLongBiFunctionbut with restricted parameter types.- Type Parameters:
T- the first parameter typeU- the second parameter typeTT- the restricted first parameter typeUU- the restricted second parameter type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,E extends EE, ExceptionConsumer<TT,TT extends T, EE extends Exception> EE> cast(ExceptionConsumer<T, E> consumer) Returns aExceptionConsumerwith identical behavior to the specifiedExceptionConsumerbut with restricted parameter type and relaxed exception type.- Type Parameters:
T- the parameter typeE- the exception typeTT- the restricted parameter typeEE- the relaxed exception type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
public static <T,E extends EE, ExceptionPredicate<TT,TT extends T, EE extends Exception> EE> cast(ExceptionPredicate<T, E> consumer) Returns aExceptionPredicatewith identical behavior to the specifiedExceptionPredicatebut with restricted parameter type and relaxed exception type.- Type Parameters:
T- the parameter typeE- the exception typeTT- the restricted parameter typeEE- the relaxed exception type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent predicate
-
cast
public static <T extends TT,E extends EE, ExceptionSupplier<TT,TT, EE extends Exception> EE> cast(ExceptionSupplier<T, E> supplier) Returns aExceptionSupplierwith identical behavior to the specifiedExceptionSupplierbut with relaxed return type and relaxed exception type.- Type Parameters:
T- the return typeE- the exception typeTT- the relaxed return typeEE- the relaxed exception type- Parameters:
supplier- a supplier- Returns:
- a functionally equivalent supplier
-
cast
public static <T,R extends RR, ExceptionFunction<TT,E extends EE, TT extends T, RR, EE extends Exception> RR, castEE> (ExceptionFunction<T, R, E> function) Returns aExceptionFunctionwith identical behavior to the specifiedExceptionFunctionbut with restricted parameter type, relaxed return type, and relaxed exception type.- Type Parameters:
T- the parameter typeR- the return typeE- the exception typeTT- the restricted parameter typeRR- the relaxed return typeEE- the relaxed exception type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <R extends RR,E extends EE, ExceptionIntFunction<RR,RR, EE extends Exception> EE> cast(ExceptionIntFunction<R, E> function) Returns aExceptionIntFunctionwith identical behavior to the specifiedExceptionFunctionbut with relaxed return type and relaxed exception type.- Type Parameters:
R- the return typeE- the exception typeRR- the relaxed return typeEE- the relaxed exception type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <R extends RR,E extends EE, ExceptionLongFunction<RR,RR, EE extends Exception> EE> cast(ExceptionLongFunction<R, E> function) Returns aExceptionLongFunctionwith identical behavior to the specifiedExceptionLongFunctionbut with relaxed return type and relaxed exception type.- Type Parameters:
R- the return typeE- the exception typeRR- the relaxed return typeEE- the relaxed exception type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,E extends EE, ExceptionToIntFunction<TT,TT extends T, EE extends Exception> EE> cast(ExceptionToIntFunction<T, E> function) Returns aExceptionToIntFunctionwith identical behavior to the specifiedExceptionToIntFunctionbut with restricted parameter type and relaxed exception type.- Type Parameters:
T- the parameter typeE- the exception typeTT- the restricted parameter typeEE- the relaxed exception type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,E extends EE, ExceptionToLongFunction<TT,TT extends T, EE extends Exception> EE> cast(ExceptionToLongFunction<T, E> function) Returns aExceptionToLongFunctionwith identical behavior to the specifiedExceptionToLongFunctionbut with restricted parameter type and relaxed exception type.- Type Parameters:
T- the parameter typeE- the exception typeTT- the restricted parameter typeEE- the relaxed exception type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,E extends EE, ExceptionBiConsumer<TT,TT extends T, U, UU extends U, EE extends Exception> UU, castEE> (ExceptionBiConsumer<T, U, E> consumer) Returns aExceptionBiConsumerwith identical behavior to the specifiedExceptionBiConsumerbut with restricted parameter types and relaxed exception type.- Type Parameters:
T- the first parameter typeE- the exception typeTT- the restricted first parameter typeU- the second parameter typeUU- the restricted second parameter typeEE- the relaxed exception type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
public static <T,E extends EE, ExceptionObjIntConsumer<TT,TT extends T, EE extends Exception> EE> cast(ExceptionObjIntConsumer<T, E> consumer) Returns aExceptionObjIntConsumerwith identical behavior to the specifiedExceptionObjIntConsumerbut with restricted parameter type and relaxed exception type.- Type Parameters:
T- the parameter typeE- the exception typeTT- the restricted parameter typeEE- the relaxed exception type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
public static <T,E extends EE, ExceptionObjLongConsumer<TT,TT extends T, EE extends Exception> EE> cast(ExceptionObjLongConsumer<T, E> consumer) Returns aExceptionObjLongConsumerwith identical behavior to the specifiedExceptionObjLongConsumerbut with restricted parameter type and relaxed exception type.- Type Parameters:
T- the parameter typeE- the exception typeTT- the restricted parameter typeEE- the relaxed exception type- Parameters:
consumer- a consumer- Returns:
- a functionally equivalent consumer
-
cast
public static <T,U, ExceptionBiPredicate<TT,E extends EE, TT extends T, UU extends U, EE extends Exception> UU, castEE> (ExceptionBiPredicate<T, U, E> predicate) Returns aExceptionBiPredicatewith identical behavior to the specifiedExceptionBiPredicatebut with restricted parameter types and relaxed exception type.- Type Parameters:
T- the first parameter typeU- the second parameter typeE- the exception typeTT- the restricted first parameter typeUU- the restricted second parameter typeEE- the relaxed exception type- Parameters:
predicate- a predicate- Returns:
- a functionally equivalent predicate
-
cast
public static <T,U, ExceptionBiFunction<TT,R extends RR, E extends EE, TT extends T, UU extends U, RR, EE extends Exception> UU, castRR, EE> (ExceptionBiFunction<T, U, R, E> function) Returns aExceptionBiFunctionwith identical behavior to the specifiedExceptionBiFunctionbut with restricted parameter types, relaxed return type, and relaxed exception type.- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the return typeE- the exception typeTT- the restricted first parameter typeUU- the restricted second parameter typeRR- the relaxed return typeEE- the relaxed exception type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,U, ExceptionToIntBiFunction<TT,E extends EE, TT extends T, UU extends U, EE extends Exception> UU, castEE> (ExceptionToIntBiFunction<T, U, E> function) Returns aExceptionToIntBiFunctionwith identical behavior to the specifiedExceptionToIntBiFunctionbut with restricted parameter types and relaxed exception type.- Type Parameters:
T- the first parameter typeU- the second parameter typeE- the exception typeTT- the restricted first parameter typeUU- the restricted second parameter typeEE- the relaxed exception type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-
cast
public static <T,U, ExceptionToLongBiFunction<TT,E extends EE, TT extends T, UU extends U, EE extends Exception> UU, castEE> (ExceptionToLongBiFunction<T, U, E> function) Returns aExceptionToLongBiFunctionwith identical behavior to the specifiedExceptionToLongBiFunctionbut with restricted parameter types and relaxed exception type.- Type Parameters:
T- the first parameter typeU- the second parameter typeE- the exception typeTT- the restricted first parameter typeUU- the restricted second parameter typeEE- the relaxed exception type- Parameters:
function- a function- Returns:
- a functionally equivalent function
-