# OverwritingInputMerger

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/OverwritingInputMerger.kt+class:androidx.work.OverwritingInputMerger) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

*** ** * ** ***


```
public final class OverwritingInputMerger extends InputMerger
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.work.InputMerger](https://developer.android.com/reference/androidx/work/InputMerger) ||
|   | ↳ | [androidx.work.OverwritingInputMerger](https://developer.android.com/reference/androidx/work/OverwritingInputMerger) |

*** ** * ** ***

An `https://developer.android.com/reference/androidx/work/InputMerger` that attempts to add all keys from all inputs to the output. In case of a conflict, this class will overwrite the previously-set key. Because there is no defined order for inputs, this implementation is best suited for cases where conflicts will not happen, or where overwriting is a valid strategy to deal with them.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/work/OverwritingInputMerger#OverwritingInputMerger()()` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/work/Data` | `https://developer.android.com/reference/androidx/work/OverwritingInputMerger#merge(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/work/Data> inputs)` Merges a list of `https://developer.android.com/reference/androidx/work/Data` and outputs a single Data object. |

## Public constructors

### OverwritingInputMerger

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

```
public OverwritingInputMerger()
```

## Public methods

### merge

```
public @NonNull Data merge(@NonNull List<@NonNull Data> inputs)
```

Merges a list of `https://developer.android.com/reference/androidx/work/Data` and outputs a single Data object.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/work/Data> inputs` | A list of `https://developer.android.com/reference/androidx/work/Data` |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/work/Data` | The merged output |