# InputMergerFactory

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

*** ** * ** ***


```
public abstract class InputMergerFactory
```

<br />

*** ** * ** ***

A factory object that creates `https://developer.android.com/reference/androidx/work/InputMerger` instances. The factory is invoked every time a work runs. You can override the default implementation of this factory by manually initializing `https://developer.android.com/reference/androidx/work/WorkManager` (see `https://developer.android.com/reference/androidx/work/WorkManager#initialize(android.content.Context,androidx.work.Configuration)` and specifying a new `https://developer.android.com/reference/androidx/work/InputMergerFactory` in `https://developer.android.com/reference/androidx/work/Configuration.Builder#setInputMergerFactory(androidx.work.InputMergerFactory)`.

## Summary

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

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/androidx/work/InputMerger` | `https://developer.android.com/reference/androidx/work/InputMergerFactory#createInputMerger(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html className)` Override this method to create an instance of a `https://developer.android.com/reference/androidx/work/InputMerger` given its fully qualified class name. |

## Public constructors

### InputMergerFactory

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

```
public InputMergerFactory()
```

## Public methods

### createInputMerger

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

```
public abstract InputMerger createInputMerger(@NonNull String className)
```

Override this method to create an instance of a `https://developer.android.com/reference/androidx/work/InputMerger` given its fully qualified class name.

Throwing an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-exception/index.html` here will crash the application. If an `https://developer.android.com/reference/androidx/work/InputMergerFactory` is unable to create an instance of a `https://developer.android.com/reference/androidx/work/InputMerger`, it should return `null` so it can delegate to the default `https://developer.android.com/reference/androidx/work/InputMergerFactory`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html className` | The fully qualified class name for the `https://developer.android.com/reference/androidx/work/InputMerger` |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/work/InputMerger` | an instance of `https://developer.android.com/reference/androidx/work/InputMerger` |