1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2026-06-04 10:38:19 +08:00

docs(sample): Add sample codes. 🥚

This commit is contained in:
2024-01-04 21:18:26 +08:00
parent 97db8204dc
commit 9647591b0d
3 changed files with 32 additions and 0 deletions
+11
View File
@@ -51,6 +51,13 @@ public class Sample {
@InlineComment("Enabled?") // 行内注释
ConfiguredValue<Boolean> ENABLED = ConfiguredValue.of(true);
ConfiguredList<UUID> UUIDS = ConfiguredList.builderOf(UUID.class).fromString()
.parseValue(UUID::fromString).serializeValue(UUID::toString)
.defaults(
UUID.fromString("00000000-0000-0000-0000-000000000000"),
UUID.fromString("00000000-0000-0000-0000-000000000001")
).build();
interface INFO extends Configuration {
@HeaderComment("Configure your name!") // 头部注释
@@ -79,6 +86,10 @@ public class Sample {
enabled: true # Enabled?
uuids:
- 00000000-0000-0000-0000-000000000000
- 00000000-0000-0000-0000-000000000001
info:
# Configure your name!
name: Joker