# UnaryOperator

public interface **UnaryOperator** implements [Function](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html)\<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.

This is a [functional interface](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/package-summary)
whose functional method is `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html#apply(T)`.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html`

### Public Method Summary

|---|---|
| static \<T\> [UnaryOperator](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/UnaryOperator.html)\<T\> | [identity](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/UnaryOperator.html#identity())() Returns a unary operator that always returns its input argument. |

### Inherited Method Summary

From interface [java.util.function.Function](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html)

|---|---|
| \<V\> [Function](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html)\<T, V\> | [andThen](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html#andThen(java.util.function.Function<?%20super%20R,%20?%20extends%20V>))([Function](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html)\<? super R, ? extends V\> after) Returns a composed function that first applies this function to its input, and then applies the `after` function to the result. |
| abstract T | [apply](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html#apply(T))(T t) Applies this function to the given argument. |
| \<V\> [Function](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html)\<V, T\> | [compose](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html#compose(java.util.function.Function<?%20super%20V,%20?%20extends%20T>))([Function](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html)\<? super V, ? extends T\> before) Returns a composed function that first applies the `before` function to its input, and then applies this function to the result. |
| static \<T\> [Function](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html)\<T, T\> | [identity](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/Function.html#identity())() Returns a function that always returns its input argument. |

## Public Methods

#### public static [UnaryOperator](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/function/UnaryOperator.html)\<T\>
**identity**
()

Returns a unary operator that always returns its input argument.

##### Returns

- a unary operator that always returns its input argument