Package org.wildfly.clustering.function
Interface UnaryOperator<T>
- Type Parameters:
T- the operating type
- All Superinterfaces:
Function<T,,T> Function<T,,T> UnaryOperator<T>
An enhanced unary operator.
- Author:
- Paul Ferraro
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault UnaryOperator<T> andThen(UnaryOperator<T> operator) Returns an operator that applies the specified operator to the result of this operator.static <T> UnaryOperator<T> Returns an operator view of the specified function.default UnaryOperator<T> compose(UnaryOperator<T> operator) Returns an operator that applies this operator to the result of the specified operator.static <T> UnaryOperator<T> empty()Returns an operator that always returns null, ignoring its parameter.static <T> UnaryOperator<T> Returns an operator that returns the result of the specified supplier, ignoring its parameter.default UnaryOperator<T> handle(BiFunction<T, RuntimeException, T> handler) Returns a new operator that delegates to this operator using the specified exception handler.static <T> UnaryOperator<T> identity()Returns an operator that returns its value.static <T> UnaryOperator<T> of(T value) Returns an operator that always returns the specified value, ignoring its parameter.default UnaryOperator<T> Returns an operator that applies this function to the value returned by the specified provider if its value does not match the specified predicate.default UnaryOperator<T> withDefault(Predicate<T> predicate, Supplier<T> defaultValue) Returns an operator that applies this function if its parameter matches the specified predicate, or returns the value provided by the specified supplier otherwise.
-
Field Details
-
IDENTITY
-
NULL
-
-
Method Details
-
orDefault
Returns an operator that applies this function to the value returned by the specified provider if its value does not match the specified predicate.- Specified by:
orDefaultin interfaceFunction<T,T> - Parameters:
predicate- a predicate used to determine the parameter of this functiondefaultResult- a provider of the default parameter valuedefaultValue- a provider of the default parameter value- Returns:
- an operator that applies this function to the value returned by the specified provider if its value does not match the specified predicate.
-
withDefault
Returns an operator that applies this function if its parameter matches the specified predicate, or returns the value provided by the specified supplier otherwise.- Specified by:
withDefaultin interfaceFunction<T,T> - Parameters:
predicate- a predicate used to determine the parameter of this functiondefaultValue- a provider of the default parameter valuedefaultResult- a provider of the default parameter value- Returns:
- an operator that applies this function if its parameter matches the specified predicate, or returns the value provided by the specified supplier otherwise.
-
andThen
Returns an operator that applies the specified operator to the result of this operator.- Parameters:
operator- an operator to apply to the result of this operation- Returns:
- an operator that applies the specified operator to the result of this operator.
-
compose
Returns an operator that applies this operator to the result of the specified operator.- Parameters:
operator- an operator to apply to the result of this operation- Returns:
- an operator that applies this operator to the result of the specified operator.
-
handle
Returns a new operator that delegates to this operator using the specified exception handler. -
identity
Returns an operator that returns its value.- Type Parameters:
T- the operating type- Returns:
- an operator that returns its value.
-
empty
Returns an operator that always returns null, ignoring its parameter.- Type Parameters:
T- the operating type- Parameters:
value- the value returned by the operator- Returns:
- an operator that always returns null, ignoring its parameter.
-
of
Returns an operator that always returns the specified value, ignoring its parameter.- Type Parameters:
T- the operating type- Parameters:
value- the value returned by the operator- Returns:
- an operator that always returns the specified value, ignoring its parameter.
-
get
Returns an operator that returns the result of the specified supplier, ignoring its parameter.- Type Parameters:
T- the operating type- Parameters:
supplier- the supplier of the operator result- Returns:
- an operator that returns the result of the specified supplier, ignoring its parameter.
-
apply
Returns an operator view of the specified function.- Type Parameters:
T- the operating type- Parameters:
function- the delegating function- Returns:
- an operator view of the specified function.
-