# OverwritingInputMerger

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/work/OverwritingInputMerger "View this page in Java")

<br />

```
class OverwritingInputMerger : InputMerger
```

<br />

|---|---|-----------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                |||
| ↳ | [androidx.work.InputMerger](https://developer.android.com/reference/kotlin/androidx/work/InputMerger)                          ||
|   | ↳ | [androidx.work.OverwritingInputMerger](https://developer.android.com/reference/kotlin/androidx/work/OverwritingInputMerger) |

*** ** * ** ***

An[InputMerger](https://developer.android.com/reference/kotlin/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                                                           |
|--------------------------------------------------------------------------------------------------------------------------------------------|
| [OverwritingInputMerger](https://developer.android.com/reference/kotlin/androidx/work/OverwritingInputMerger#OverwritingInputMerger())`()` |

|                               ### Public functions                               |
|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open `[Data](https://developer.android.com/reference/kotlin/androidx/work/Data) | [merge](https://developer.android.com/reference/kotlin/androidx/work/OverwritingInputMerger#merge(kotlin.collections.List))`(inputs: `[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Data](https://developer.android.com/reference/kotlin/androidx/work/Data)`>)` Merges a list of[Data](https://developer.android.com/reference/kotlin/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)  

```
OverwritingInputMerger()
```  

## Public functions

### merge

```
open fun merge(inputs: List<Data>): Data
```

Merges a list of[Data](https://developer.android.com/reference/kotlin/androidx/work/Data)and outputs a single Data object.  

|                                                                                     Parameters                                                                                     |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| `inputs: `[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Data](https://developer.android.com/reference/kotlin/androidx/work/Data)`>` | A list of[Data](https://developer.android.com/reference/kotlin/androidx/work/Data) |

|                                  Returns                                  |
|---------------------------------------------------------------------------|-------------------|
| [Data](https://developer.android.com/reference/kotlin/androidx/work/Data) | The merged output |