1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2026-06-04 18:48:20 +08:00

refactor deserialize, add set collection dsl

This commit is contained in:
huanmeng-qwq
2025-09-27 02:49:57 +08:00
committed by Carm
parent fc4a11bc3e
commit 4a0e6b0676
5 changed files with 171 additions and 45 deletions
@@ -96,6 +96,7 @@ public class ConfigurationTest {
System.out.println("> Test Kotlin value after:");
System.out.println(KotlinConfiguration.INSTANCE.getLINKED_MAP().get());
System.out.println("> Test Set value -> " + KotlinConfiguration.INSTANCE.getBLACK_LIST().get());
}
public static void save(ConfigurationHolder<?> provider) {
@@ -16,6 +16,10 @@ object KotlinConfiguration : Configuration {
defaults("Carm Jos")
}
val BLACK_LIST = setFrom(String::class) {
defaults("404", "404", "123")
}
val NICKNAME = mapFrom(String::class, ::mutableMapOf) {
defaultMap(mapOf("Carm Jos" to "Carm"))
parse { v -> v }