src/share/classes/java/util/function/UnaryOperator.java
Print this page
rev 7675 : 8019840: Spec updates for java.util.function
Reviewed-by: mduigou
Contributed-by: brian.goetz@oracle.com
@@ -23,27 +23,30 @@
* questions.
*/
package java.util.function;
/**
- * An operation upon a single operand yielding a result. The operand and the
- * result are of the same type. This is a specialization of {@code Function} for
+ * Represents an operation on a single operand that produces a result of the
+ * same type as its operand. This is a specialization of {@code Function} for
* the case where the operand and result are of the same type.
*
- * @param <T> the type of operand to {@code apply} and of the result
+ * <p>This is a <a href="package-summary.html">functional interface</a>
+ * whose functional method is {@link #apply(Object)}.
+ *
+ * @param <T> the type of the operand and result of the operator
*
* @see Function
* @since 1.8
*/
@FunctionalInterface
public interface UnaryOperator<T> extends Function<T, T> {
/**
- * Returns a unary operator that provides its input value as the result.
+ * Returns a unary operator that always returns its input argument.
*
- * @param <T> the type of the input and output objects to the function
- * @return a unary operator that provides its input value as the result
+ * @param <T> the type of the input and output of the operator
+ * @return a unary operator that always returns its input argument
*/
static <T> UnaryOperator<T> identity() {
return t -> t;
}
}