# Consumer

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/util/Consumer.kt+class:androidx.core.util.Consumer) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public fun interface Consumer<T extends Object>
```

<br />

Known direct subclasses [TestConsumer](https://developer.android.com/reference/androidx/core/testing/util/TestConsumer)

|---|---|
| `https://developer.android.com/reference/androidx/core/testing/util/TestConsumer` | An implementation of `https://developer.android.com/reference/androidx/core/util/Consumer` to capture values during a test and allows developers to perform assertions on the values. |

*** ** * ** ***

Compat version of `https://developer.android.com/reference/java/util/function/Consumer.html`

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | the type of the input to the operation |

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/core/util/Consumer#accept(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull T value)` Performs this operation on the given argument. |

## Public methods

### accept

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
abstract void accept(@NonNull T value)
```

Performs this operation on the given argument.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull T value` | the input argument |