Stay organized with collections
Save and categorize content based on your preferences.
AI-generated Key Takeaways
UnaryOperator represents an operation on a single operand, producing a result of the same type.
It is a specialization of the Function interface for cases where the operand and result types are identical.
The primary method is apply, inherited from Function, which applies the operation to the given argument.
UnaryOperator provides a static identity method, returning an operator that simply returns its input unchanged.
public interface
UnaryOperator
implements
Function<T, T>
Represents an operation on a single operand that produces a result of the
same type as its operand. This is a specialization of Function for
the case where the operand and result are of the same type.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[],["The `UnaryOperator` interface represents an operation on a single operand, producing a result of the same type. It extends `Function` and its core method is `apply(T t)`, which applies the function to the input argument. It includes the `identity()` method, which returns a `UnaryOperator` that returns its input. `andThen` and `compose` methods are available.\n"]]