/* * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package java.util.function; /** * 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. * *

This is a functional interface * whose functional method is {@link #apply(Object)}. * * @param the type of the operand and result of the operator * * @see Function * @since 1.8 */ @FunctionalInterface public interface UnaryOperator extends Function { /** * Returns a unary operator that always returns its input argument. * * @param the type of the input and output of the operator * @return a unary operator that always returns its input argument */ static UnaryOperator identity() { return t -> t; } }