Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# IntUnaryOperator

` public interface IntUnaryOperator `   
` `

|---|
| java.util.function.IntUnaryOperator |

<br />

*** ** * ** ***

Represents an operation on a single `int`-valued operand that produces an `int`-valued result. This is the primitive type specialization of `https://developer.android.com/reference/java/util/function/UnaryOperator` for `int`.

This is a [functional interface](https://developer.android.com/reference/java/util/function/package-summary) whose functional method is `https://developer.android.com/reference/java/util/function/IntUnaryOperator#applyAsInt(int)`.
**See also:**

- `https://developer.android.com/reference/java/util/function/UnaryOperator`

## Summary

| ### Public methods ||
|---|---|
| ` default https://developer.android.com/reference/java/util/function/IntUnaryOperator` | ` https://developer.android.com/reference/java/util/function/IntUnaryOperator#andThen(java.util.function.IntUnaryOperator)(https://developer.android.com/reference/java/util/function/IntUnaryOperator after) ` Returns a composed operator that first applies this operator to its input, and then applies the `after` operator to the result. |
| ` abstract int` | ` https://developer.android.com/reference/java/util/function/IntUnaryOperator#applyAsInt(int)(int operand) ` Applies this operator to the given operand. |
| ` default https://developer.android.com/reference/java/util/function/IntUnaryOperator` | ` https://developer.android.com/reference/java/util/function/IntUnaryOperator#compose(java.util.function.IntUnaryOperator)(https://developer.android.com/reference/java/util/function/IntUnaryOperator before) ` Returns a composed operator that first applies the `before` operator to its input, and then applies this operator to the result. |
| ` static https://developer.android.com/reference/java/util/function/IntUnaryOperator` | ` https://developer.android.com/reference/java/util/function/IntUnaryOperator#identity()() ` Returns a unary operator that always returns its input argument. |

## Public methods

### andThen

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public IntUnaryOperator andThen (IntUnaryOperator after)
```

Returns a composed operator that first applies this operator to its input, and then applies the `after` operator to the result. If evaluation of either operator throws an exception, it is relayed to the caller of the composed operator.

<br />

| Parameters ||
|---|---|
| `after` | `IntUnaryOperator`: the operator to apply after this operator is applied <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/function/IntUnaryOperator` | a composed operator that first applies this operator and then applies the `after` operator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if after is null |

**See also:**

- `https://developer.android.com/reference/java/util/function/IntUnaryOperator#compose(java.util.function.IntUnaryOperator)`

### applyAsInt

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract int applyAsInt (int operand)
```

Applies this operator to the given operand.

<br />

| Parameters ||
|---|---|
| `operand` | `int`: the operand <br /> |

| Returns ||
|---|---|
| `int` | the operator result <br /> |

### compose

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public IntUnaryOperator compose (IntUnaryOperator before)
```

Returns a composed operator that first applies the `before` operator to its input, and then applies this operator to the result. If evaluation of either operator throws an exception, it is relayed to the caller of the composed operator.

<br />

| Parameters ||
|---|---|
| `before` | `IntUnaryOperator`: the operator to apply before this operator is applied <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/function/IntUnaryOperator` | a composed operator that first applies the `before` operator and then applies this operator <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if before is null |

**See also:**

- `https://developer.android.com/reference/java/util/function/IntUnaryOperator#andThen(java.util.function.IntUnaryOperator)`

### identity

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static IntUnaryOperator identity ()
```

Returns a unary operator that always returns its input argument.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/function/IntUnaryOperator` | a unary operator that always returns its input argument <br /> |