Enum Class ConfigValueSource
- All Implemented Interfaces:
Serializable,Comparable<ConfigValueSource>,Constable
配置值来源
用于严格区分"用户配置了"与"值恰好等于默认值":
用户文件里没有 port → get=默认值, contains=false, isDefault=true 用户文件里写了 port: 25565 → get=25565, contains=true, isDefault=false(即使它等于默认值)
未来可扩展 PROGRAMMATIC / ENVIRONMENT / COMMAND 等来源;
本阶段只实现 DEFAULT 与 USER。
- Since:
- 0.6.12
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigValueSourceReturns the enum constant of this class with the specified name.static ConfigValueSource[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
值来自ConfigKey声明的默认值(用户文件中不存在该字段) -
USER
值来自用户配置(或运行时显式set)
-
-
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
-