Class AdaptiveYamlMergePolicy

java.lang.Object
net.mcreator.util.yaml.AdaptiveYamlMergePolicy
All Implemented Interfaces:
YamlMerge.MergePolicy

public class AdaptiveYamlMergePolicy extends Object implements YamlMerge.MergePolicy
  • Constructor Details

    • AdaptiveYamlMergePolicy

      public AdaptiveYamlMergePolicy(String uniqueKeySource)
  • Method Details

    • mergeList

      public void mergeList(Object key, List<Object> existing, List<Object> addition) throws Exception
      Merges two lists. The default implementation appends the addition list to the existing list. If the lists contain maps with a specified unique key, it merges them based on the merge policy for each entry.

      Possible merge policies (merging is done for every plugin depending on plugin weight): - append (default): adds the entry to the end of the list - append_start: adds the entry to the start of the list - remove_all: removes all entries that match the unique key and does not add the entry - override_all: removes all entries that match the unique key and adds the entry

      Keep in mind that a plugin evaluated after this plugin can re-add an entry this plugin requested deletion of

      Specified by:
      mergeList in interface YamlMerge.MergePolicy
      Throws:
      Exception