Enum Class DiffType

java.lang.Object
java.lang.Enum<DiffType>
cloud.opencode.base.yml.diff.DiffType
All Implemented Interfaces:
Serializable, Comparable<DiffType>, Constable

public enum DiffType extends Enum<DiffType>
Diff Type - Enumeration of YAML diff change types 差异类型 - YAML 差异变更类型枚举

Represents the kind of change detected when comparing two YAML documents.

表示比较两个 YAML 文档时检测到的变更类型。

Features | 主要功能:

  • ADDED - a key/value exists only in the new document - 仅在新文档中存在的键/值
  • REMOVED - a key/value exists only in the base document - 仅在基础文档中存在的键/值
  • MODIFIED - a key exists in both but values differ - 键在两者中都存在但值不同

Usage Examples | 使用示例:

DiffEntry entry = DiffEntry.added("server.port", 8080);
assert entry.type() == DiffType.ADDED;

Security | 安全性:

  • Thread-safe: Yes (immutable enum) - 线程安全: 是(不可变枚举)
Since:
JDK 25, opencode-base-yml V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • ADDED

      public static final DiffType ADDED
      A new key/value was added. 新增了键/值。
    • REMOVED

      public static final DiffType REMOVED
      An existing key/value was removed. 移除了已有的键/值。
    • MODIFIED

      public static final DiffType MODIFIED
      An existing key's value was modified. 修改了已有键的值。
  • Method Details

    • values

      public static DiffType[] 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 DiffType 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