UpdaterSettings
Updater settings cover all options related explicitly (only) to file updating.
Last updated
Updater settings cover all options related explicitly (only) to file updating.
Last updated
Settings introduced by BoostedYAML follow builder design pattern, e.g. you may build your own settings using:
Sets if the file should automatically be saved using after the updater has finished updating (does not save if nothing's changed).
Not effective if there is no file associated with the document.
Default: true
(enabled)
Sets versioning information. You can read more about the document versioning system (DVS) .
To supply versioning object carrying DVS information directly, you can use the first method. Please always read the method documentation you are going to use.
Default: none
Sets if to enable downgrading.
Default: true
(enabled)
Sets how to sort options in sections during merging (last stage of updating).
OptionSorting.SORT_BY_DEFAULTS
- Sorts options by their order in the defaults. This setting ensures that entries which will appear in the merged document will be placed into the section map in order defined by the defaults.
OptionSorting.NONE
- Does not sort (does not introduce any additional memory consumption). This setting ensures that new entries from the defaults will be placed as the last into the section map.
If the used implementation does not preserve order of the elements (as they were put into the map), avoid additional memory consumption and use OptionSorting.NONE
instead.
Default: OptionSorting.SORT_BY_DEFAULTS
Sets merge preservation rules.
Merge rules determine what content to preserve, when there is a block (object) at the same path in both the document that's being updated and defaults. There is no rule for section-section situation - in this case, the updater traverses those sections and compares the contents, rather than comparing them.
The boolean represents if to preserve content already in the document instead of the equivalent from defaults. Please note that this applies to blocks - including their content (comments, also the submappings if a section).
Default: MergeRule.MAPPINGS
-> true
(user), MergeRule.MAPPING_AT_SECTION
-> false
(default), MergeRule.SECTION_AT_MAPPING
-> false
(default)
Sets if to keep all non-merged (that don't have an equivalent in the defaults) blocks in the document instead of deleting them.
Default: false
(disabled)
Adds routes to ignore if updating to the provided version ID (see example below). Ignored routes and their corresponding blocks and contents will be excluded from merging and will appear in the updated document (no matter the merge rules). Always read the method documentation.
Ignoring routes is generally useful for sections which users can freely extend and their content is not strictly defined.
In this sense, we can say that you should specify a version ID of the document and routes of such sections (which were in the document with the ID).
Default: none
Adds relocations (in from route = to route
format) that took effect at the provided version ID.
Relocations represent that some mapping was moved from route x to y, which implies no content loss while updating. The ID at which a relocation took effect is the ID of the document which included the changes (see example below). Always read the method documentation.
Relocations are useful if you moved something in the document to another place.
Updating cycle for each version ID in the corresponding range (first to last): relocations -> mappers -> custom logic.
Default: none
Adds mappers to apply to their respective routes, per version ID.
Mappers can be used to map (= transform) a value at a route, to different value or from one type to another (for example from a boolean to an enum, see example below). The ID at which to apply a mapper is the ID of the document which included the datatype change. Always read the method documentation.
Mappers run after relocations, so you can freely combine them.
Mappers are useful if you decided to change a value to represent the same, but using another datatype (for example, you now have a multi-constant enum for which was previously only true/false setting).
Updating cycle for each version ID in the corresponding range (first to last): relocations -> mappers -> custom logic.
Default: none
Adds custom logic to run on the document, per version ID.
You can use your own logic to make changes to the document which are not available via the ignored routes, relocations or mappers. The order in which the consumers are run is undefined and may vary.
Custom logic is run after relocations and mappers, so you can freely combine them.
Updating cycle for each version ID in the corresponding range (first to last): relocations -> mappers -> custom logic.
Default: none
Effective if and only a is specified.
If the updater detects downgrading, and it is enabled, the updater will skip relocations, proceeding directly to merging; throws an error otherwise. If configured like so, you may also want to disable (if an error is thrown, you won't be able to create the document).
The order depends on the map implementation defined by the .
In case of the map-based method, overwrites only rules that are defined in the given .
Effective if and only a is specified.
Effective if and only a is specified.
Effective if and only a is specified.
Effective if and only a is specified.