Package org.wildfly.clustering.function
Interface BiFunction<T,U,R>
- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the result type
- All Superinterfaces:
BiFunction<T,U, R>
- All Known Subinterfaces:
BinaryOperator<T>
- All Known Implementing Classes:
BiFunction.FormerIdentityFunction,BiFunction.LatterIdentityFunction,BinaryOperator.FormerIdentityOperator,BinaryOperator.LatterIdentityOperator,HotRodSessionMetaDataFactory
An enhanced binary function.
- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBiFunction.FormerIdentityFunction<T extends R,U, R> static classBiFunction.LatterIdentityFunction<T,U extends R, R> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BiFunction<?, ?, ?> static final BiFunction<?, ?, ?> static final BiFunction<?, ?, ?> -
Method Summary
Modifier and TypeMethodDescriptiondefault <V> BiFunction<T, U, V> default <V1,V2> BiFunction <V1, V2, R> Returns a composed function that applies the specified functions to each parameter as inputs to this function.static <T extends R,U, R>
BiFunction<T, U, R> former()Returns a function that returns its first parameter.static <T,U, R> BiFunction <T, U, R> Returns a function that returns the result of applying the specified function to its first parameter.static <T,U extends R, R>
BiFunction<T, U, R> latter()Returns a function that returns its second parameter.static <T,U, R> BiFunction <T, U, R> Returns a function that returns the result of applying the specified function to its second parameter.static <T,U, R> BiFunction <T, U, R> Returns a function that returns the value returned by the specified supplier, ignoring its parameter.static <T,U, R> BiFunction <T, U, R> of(R result) Returns a function that always returns the specified value, ignoring its parameter.default BiFunction<T, U, R> Returns a function that applies this function if its parameters matches the specified predicate, or returns the value provided by the specified supplier otherwise.default BiFunction<U, T, R> reverse()Returns a function that processes this function with reversed parameter order.default BiFunction<T, U, R> withDefault(Predicate<T> predicate1, Supplier<T> defaultValue1, Predicate<U> predicate2, Supplier<U> defaultValue2) Returns a function that applies this function to the values returned by the specified providers if its parameters do not match the specified predicates.Methods inherited from interface java.util.function.BiFunction
apply
-
Field Details
-
FORMER_IDENTITY
-
LATTER_IDENTITY
-
NULL
-
-
Method Details
-
compose
default <V1,V2> BiFunction<V1,V2, composeR> (Function<? super V1, ? extends T> before1, Function<? super V2, ? extends U> before2) Returns a composed function that applies the specified functions to each parameter as inputs to this function.- Type Parameters:
V1- the first parameter function typeV2- the second parameter function type- Parameters:
before1- the function applied to the first parameterbefore2- the function applied to the second parameter- Returns:
- a composed function that applies the specified functions to each parameter as inputs to this function.
-
andThen
- Specified by:
andThenin interfaceBiFunction<T,U, R>
-
reverse
Returns a function that processes this function with reversed parameter order.- Returns:
- a function that processes this function with reversed parameter order.
-
withDefault
default BiFunction<T,U, withDefaultR> (Predicate<T> predicate1, Supplier<T> defaultValue1, Predicate<U> predicate2, Supplier<U> defaultValue2) Returns a function that applies this function to the values returned by the specified providers if its parameters do not match the specified predicates.- Parameters:
predicate1- a predicate used to determine the first parameter of this functiondefaultValue1- a provider of the default value of the first parameterpredicate2- a predicate used to determine the second parameter of this functiondefaultValue2- a provider of the default value of the second parameter- Returns:
- a function that applies this function to the value returned by the specified provider if its value does not match the specified predicate.
-
orDefault
Returns a function that applies this function if its parameters matches the specified predicate, or returns the value provided by the specified supplier otherwise.- Parameters:
predicate- a predicate used to determine the parameter of this functiondefaultResult- a provider of the default parameter value- Returns:
- a function that applies this function if its parameter matches the specified predicate, or returns the value provided by the specified supplier otherwise.
-
former
Returns a function that returns its first parameter.- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the function return type- Returns:
- a function that returns its first parameter.
-
former
Returns a function that returns the result of applying the specified function to its first parameter.- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the function return type- Parameters:
function- the function applied to the first parameter of this function- Returns:
- a function that returns the result of applying the specified function to its first parameter.
-
latter
Returns a function that returns its second parameter.- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the function return type- Returns:
- a function that returns its first parameter.
-
latter
Returns a function that returns the result of applying the specified function to its second parameter.- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the function return type- Parameters:
function- the function applied to the second parameter of this function- Returns:
- a function that returns the result of applying the specified function to its second parameter.
-
of
Returns a function that always returns the specified value, ignoring its parameter.- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the function return type- Parameters:
result- the function result- Returns:
- a function that always returns the specified value, ignoring its parameter.
-
of
Returns a function that returns the value returned by the specified supplier, ignoring its parameter.- Type Parameters:
T- the first parameter typeU- the second parameter typeR- the function return type- Parameters:
supplier- the function result supplier- Returns:
- a function that returns the value returned by the specified supplier, ignoring its parameter.
-