Stay organized with collections Save and categorize content based on your preferences.

OverwritingInputMerger

public final class OverwritingInputMerger extends InputMerger


An 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

Public methods

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

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

Public constructors

OverwritingInputMerger

public OverwritingInputMerger()

Public methods

merge

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

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

Parameters
@NonNull List<Data> inputs

A list of Data

Returns
@NonNull Data

The merged output