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.configParameters
the type of the configuration object
Inheritors
Functions
Fills in null or blank fields with default values if applicable.
Reloads the configuration object from the backing file.
Attempts to update the configuration file by merging the default resource with the current file, preserving user-defined values.
Validates the configuration object based on field annotations such as net.ririfa.yacla.annotation.Required and net.ririfa.yacla.annotation.Range.