Package org.wildfly.clustering.function
Interface BinaryOperator<T>
- Type Parameters:
T- the operator type
- All Superinterfaces:
BiFunction<T,,T, T> BiFunction<T,,T, T> BinaryOperator<T>
An enhanced binary function.
- Author:
- Paul Ferraro
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BinaryOperator<?> static final BinaryOperator<?> static final BinaryOperator<?> -
Method Summary
Modifier and TypeMethodDescriptiondefault BinaryOperator<T> andThen(UnaryOperator<T> after) static <T> BinaryOperator<T> apply(BiFunction<? super T, ? super T, T> function) Returns an operator view of the specified binary function.default BinaryOperator<T> compose(UnaryOperator<T> before1, UnaryOperator<T> before2) Returns a composed operator that applies the specified operators to each parameter as inputs to this operator.static <T> BinaryOperator<T> empty()Returns a function that always returns null, ignoring its parameter.static <T> BinaryOperator<T> former()Returns a function that returns its first parameter.static <T> BinaryOperator<T> Returns a function that returns the value returned by the specified supplier, ignoring its parameter.static <T> BinaryOperator<T> latter()Returns a function that returns its second parameter.static <T> BinaryOperator<T> of(T result) Returns a function that always returns the specified value, ignoring its parameter.default BinaryOperator<T> 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 BinaryOperator<T> reverse()Returns a function that processes this function with reversed parameter order.default BinaryOperator<T> withDefault(Predicate<T> predicate1, Supplier<T> defaultValue1, Predicate<T> predicate2, Supplier<T> 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
applyMethods inherited from interface org.wildfly.clustering.function.BiFunction
andThen, compose
-
Field Details
-
FORMER_IDENTITY
-
LATTER_IDENTITY
-
NULL
-
-
Method Details
-
compose
Returns a composed operator that applies the specified operators to each parameter as inputs to this operator.- Parameters:
before1- the operator applied to the first parameterbefore2- the operator applied to the second parameter- Returns:
- a composed operator that applies the specified operators to each parameter as inputs to this operator.
-
andThen
-
reverse
Returns a function that processes this function with reversed parameter order.- Specified by:
reversein interfaceBiFunction<T,T, T> - Returns:
- a function that processes this function with reversed parameter order.
-
withDefault
default BinaryOperator<T> withDefault(Predicate<T> predicate1, Supplier<T> defaultValue1, Predicate<T> predicate2, Supplier<T> 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.- Specified by:
withDefaultin interfaceBiFunction<T,T, T> - 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.- Specified by:
orDefaultin interfaceBiFunction<T,T, T> - 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 operating type- Returns:
- a function that returns its first parameter.
-
latter
Returns a function that returns its second parameter.- Type Parameters:
T- the operating type- Returns:
- a function that returns its first parameter.
-
empty
Returns a function that always returns null, ignoring its parameter.- Type Parameters:
T- the operating type- Parameters:
result- the function result- Returns:
- a function that always returns null, ignoring its parameter.
-
of
Returns a function that always returns the specified value, ignoring its parameter.- Type Parameters:
T- the operating type- Parameters:
result- the function result- Returns:
- a function that always returns the specified value, ignoring its parameter.
-
get
Returns a function that returns the value returned by the specified supplier, ignoring its parameter.- Type Parameters:
T- the operating type- Parameters:
supplier- the function result supplier- Returns:
- a function that returns the value returned by the specified supplier, ignoring its parameter.
-
apply
Returns an operator view of the specified binary function.- Type Parameters:
T- the operating type- Parameters:
function- the delegating function- Returns:
- an operator view of the specified function.
-