Enum Class DiffType
- All Implemented Interfaces:
Serializable, Comparable<DiffType>, Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
-
Enum Constant Details
-
ADDED
A new key/value was added. 新增了键/值。 -
REMOVED
An existing key/value was removed. 移除了已有的键/值。 -
MODIFIED
An existing key's value was modified. 修改了已有键的值。
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-