Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

ArrayCreatingInputMerger

public final class ArrayCreatingInputMerger
extends InputMerger

java.lang.Object
   ↳ androidx.work.InputMerger
     ↳ androidx.work.ArrayCreatingInputMerger


An InputMerger that attempts to merge the various inputs. For each input, we look at each key:

  • If this is the first time we encountered the key
    • If it's an array, put it in the output
    • If it's a primitive, turn it into a size 1 array and put it in the output
  • Else
    • If the value type matches the old value type
      • If they are arrays, concatenate them
      • If they are primitives, turn them into a size 2 array
    • Else if one is an array and the other is a primitive
      • Make a longer array and concatenate them
    • Else throw an IllegalArgumentException

Summary

Public constructors

ArrayCreatingInputMerger()

Public methods

Data merge(List<Data> inputs)

Merges a list of Data and outputs a single Data object.

Inherited methods

Public constructors

ArrayCreatingInputMerger

public ArrayCreatingInputMerger ()

Public methods

merge

public Data merge (List<Data> inputs)

Merges a list of Data and outputs a single Data object.

Parameters
inputs List: A list of Data from previous Workers or the WorkRequest.Builder

Returns
Data The merged output