public class Merger extends Object
| Constructor and Description |
|---|
Merger() |
| Modifier and Type | Method and Description |
|---|---|
static void |
merge(Section document,
Section defaults,
UpdaterSettings settings)
Merges the given document with the defaults.
|
public static void merge(@NotNull
Section document,
@NotNull
Section defaults,
@NotNull
UpdaterSettings settings)
Merging algorithm consists of iterating through blocks in the defaults and for each pair (document+default block) outputs the preserved one (according to the merging rules) into the document. If the block is ignored, immediately continues without changing the block. If the preserved block is the default one, deep copies it (so it is isolated from the defaults). If both blocks represent sections, iterates through these pair of subsections.
Additionally, after iteration had finished, deletes all non-merged blocks (those which are not contained in the
defaults) from the document, unless UpdaterSettings.isKeepAll() is enabled.
document - the documentdefaults - the default equivalent to the documentsettings - updater settings to useiterate(Section, Section, UpdaterSettings)Copyright © 2022. All rights reserved.