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
e42de0eee7
commit
48050a52a2
@ -58,13 +58,14 @@ public class Sample {
|
|||||||
ConfiguredValue<Boolean> ENABLED = ConfiguredValue.of(true);
|
ConfiguredValue<Boolean> ENABLED = ConfiguredValue.of(true);
|
||||||
|
|
||||||
interface INFO extends Configuration {
|
interface INFO extends Configuration {
|
||||||
|
|
||||||
@HeaderComment("Configure your name!") // Header comment
|
@HeaderComment("Configure your name!") // Header comment
|
||||||
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
||||||
|
|
||||||
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// 1. Make a configuration provider from a file.
|
// 1. Make a configuration provider from a file.
|
||||||
@ -83,8 +84,7 @@ public class Sample {
|
|||||||
```yaml
|
```yaml
|
||||||
# Configurations for sample
|
# Configurations for sample
|
||||||
|
|
||||||
# Enabled?
|
enabled: true # Enabled?
|
||||||
enabled: true
|
|
||||||
|
|
||||||
info:
|
info:
|
||||||
# Configure your name!
|
# Configure your name!
|
||||||
|
@ -52,12 +52,12 @@ public class Sample {
|
|||||||
ConfiguredValue<Boolean> ENABLED = ConfiguredValue.of(true);
|
ConfiguredValue<Boolean> ENABLED = ConfiguredValue.of(true);
|
||||||
|
|
||||||
interface INFO extends Configuration {
|
interface INFO extends Configuration {
|
||||||
|
|
||||||
@HeaderComment("Configure your name!") // 头部注释
|
@HeaderComment("Configure your name!") // 头部注释
|
||||||
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
|
||||||
|
|
||||||
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@ -76,8 +76,7 @@ public class Sample {
|
|||||||
```yaml
|
```yaml
|
||||||
# Configurations for sample
|
# Configurations for sample
|
||||||
|
|
||||||
# Enabled?
|
enabled: true # Enabled?
|
||||||
enabled: true
|
|
||||||
|
|
||||||
info:
|
info:
|
||||||
# Configure your name!
|
# Configure your name!
|
||||||
|
Loading…
Reference in New Issue
Block a user