Enum Class MergeStrategy

java.lang.Object
java.lang.Enum<MergeStrategy>
cloud.opencode.base.xml.merge.MergeStrategy
All Implemented Interfaces:
Serializable, Comparable<MergeStrategy>, Constable

public enum MergeStrategy extends Enum<MergeStrategy>
Merge Strategy - Strategies for merging XML documents 合并策略 - XML 文档的合并策略

Defines how conflicts are resolved when merging an overlay document onto a base document.

定义将覆盖文档合并到基础文档时如何解决冲突。

Features | 主要功能:

  • OVERRIDE - overlay values replace base values - 覆盖值替换基础值
  • APPEND - overlay elements are appended - 覆盖元素追加到末尾
  • SKIP_EXISTING - only add elements not in base - 仅添加基础文档中不存在的元素
Since:
JDK 25, opencode-base-xml V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • OVERRIDE

      public static final MergeStrategy OVERRIDE
      Overlay values replace base values for matching elements. 覆盖值替换匹配元素的基础值。
    • APPEND

      public static final MergeStrategy APPEND
      Overlay elements are appended to the base document. 覆盖元素追加到基础文档。
    • SKIP_EXISTING

      public static final MergeStrategy SKIP_EXISTING
      Only add elements from overlay that do not exist in base. 仅从覆盖文档中添加基础文档中不存在的元素。
  • Method Details

    • values

      public static MergeStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MergeStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null