Interface UnaryOperatorX<T>
- Type Parameters:
T- 参数类型
- All Superinterfaces:
Function<T,,T> Serializable,UnaryOperator<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
可序列化的UnaryOperator
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault TApplies this function to the given argument.Applies this function to the given argument.static <T,R, F extends Function<T, R>>
UnaryOperatorX<T> casting(F function) casting identitystatic <T> UnaryOperatorX<T> identity()Returns a unary operator that always returns its input argument.
-
Method Details
-
identity
Returns a unary operator that always returns its input argument.- Type Parameters:
T- the type of the input and output of the operator- Returns:
- a unary operator that always returns its input argument
-
casting
casting identity- Type Parameters:
T- param typeR- result typeF- lambda type- Parameters:
function- source function- Returns:
- identity after casting
-
applying
Applies this function to the given argument. -
apply
Applies this function to the given argument.
-