Class IntegerCodec
java.lang.Object
io.github.theword.queqiao.core.config.codec.IntegerCodec
- All Implemented Interfaces:
ConfigCodec<Integer>
整数编解码器
严格类型:8080.0 不会被接受为整数——
它更可能是用户写错了类型,而不是正常输入。
- Since:
- 0.6.12
-
Field Summary
Fields -
Method Summary
-
Field Details
-
INSTANCE
-
-
Method Details
-
read
Description copied from interface:ConfigCodec把 YAML 原始值解析为目标类型- Specified by:
readin interfaceConfigCodec<Integer>- Parameters:
path- 配置路径(用于报错)raw- 原始值,可能为 null(字段存在但值为空)- Returns:
- 解析结果
-
write
Description copied from interface:ConfigCodec把目标类型转成可写入 YAML 的原始值- Specified by:
writein interfaceConfigCodec<Integer>- Parameters:
value- 目标值- Returns:
- YAML 可写出的原始值
-
typeName
Description copied from interface:ConfigCodec类型名称,用于报错文案(如integer)- Specified by:
typeNamein interfaceConfigCodec<Integer>- Returns:
- 类型名称
-
copy
Description copied from interface:ConfigCodec复制值用于保证"默认值"不会在多个
Config实例之间共享同一个可变对象。 不可变类型直接返回原值。- Specified by:
copyin interfaceConfigCodec<Integer>- Parameters:
value- 目标值- Returns:
- 副本
-