Config Loader
Represents a loaded configuration file mapped to a Kotlin or Java object.
Provides access to the deserialized configuration object and lifecycle operations such as reloading, validation, filling default values, and updating the file from the default resource if outdated.
This interface is typically obtained by calling ConfigLoaderBuilder.load.
Example usage:
val loader = Yacla.loader<MyConfig>()
.fromResource("/defaults/config.yml")
.toFile(Paths.get("config.yml"))
.parser(SnakeYamlParser())
.withLogger(ConsoleLogger())
.autoUpdateIfOutdated(true)
.load()
loader.validate()
loader.nullCheck()
val config = loader.configContent copied to clipboard
Parameters
T
the type of the configuration object