mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2024-09-19 20:25:51 +00:00
docs(sample): Add sample codes. 🥚
This commit is contained in:
parent
48050a52a2
commit
97db8204dc
@ -62,6 +62,7 @@ public class Sample {
|
||||
@HeaderComment("Configure your name!") // Header comment
|
||||
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
||||
|
||||
@ConfigPath("year") // Custom path
|
||||
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
||||
|
||||
}
|
||||
@ -89,7 +90,7 @@ enabled: true # Enabled?
|
||||
info:
|
||||
# Configure your name!
|
||||
name: Joker
|
||||
age: 24
|
||||
year: 24
|
||||
```
|
||||
|
||||
### Dependencies
|
||||
|
@ -56,6 +56,7 @@ public class Sample {
|
||||
@HeaderComment("Configure your name!") // 头部注释
|
||||
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
||||
|
||||
@ConfigPath("year") // 自定义配置路径,若不定义,则按照默认规则生成
|
||||
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
||||
}
|
||||
}
|
||||
@ -81,7 +82,7 @@ enabled: true # Enabled?
|
||||
info:
|
||||
# Configure your name!
|
||||
name: Joker
|
||||
age: 24
|
||||
year: 24
|
||||
```
|
||||
|
||||
### 依赖方式
|
||||
|
@ -2,6 +2,7 @@ package config;
|
||||
|
||||
import cc.carm.lib.configuration.EasyConfiguration;
|
||||
import cc.carm.lib.configuration.core.Configuration;
|
||||
import cc.carm.lib.configuration.core.annotation.ConfigPath;
|
||||
import cc.carm.lib.configuration.core.annotation.HeaderComment;
|
||||
import cc.carm.lib.configuration.core.annotation.InlineComment;
|
||||
import cc.carm.lib.configuration.core.source.ConfigurationProvider;
|
||||
@ -18,7 +19,8 @@ public class Sample {
|
||||
interface INFO extends Configuration {
|
||||
@HeaderComment("Configure your name!") // Header comment
|
||||
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
||||
|
||||
|
||||
@ConfigPath("year") // Custom path
|
||||
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user