DefaultConfigLoaderBuilder

Default implementation of ConfigLoaderBuilder.

This builder creates a ConfigLoader for the given configuration class, allowing fluent configuration of the input resource, target file, parser, logger, and update behavior.

Typically used internally via net.ririfa.yacla.Yacla.loader, rather than instantiated directly.

Parameters

T

the type of the configuration object

Constructors

Link copied to clipboard
constructor(clazz: Class<T>)

Functions

Link copied to clipboard
open override fun autoUpdateIfOutdated(enabled: Boolean): ConfigLoaderBuilder<T>

Enables or disables automatic config updates based on resource version.

Link copied to clipboard
open override fun fromResource(path: String): ConfigLoaderBuilder<T>

Specifies the path to the resource file bundled with the application. Used as a fallback or for initial creation.

Link copied to clipboard
open override fun load(): ConfigLoader<T>

Builds and loads the config, returning a ConfigLoader instance.

Link copied to clipboard
open override fun parser(parser: ConfigParser): ConfigLoaderBuilder<T>

Sets the parser used to read and write the config file.

Link copied to clipboard
open override fun toFile(file: Path): ConfigLoaderBuilder<T>

Sets the file where the configuration will be loaded from or saved to.

Link copied to clipboard
Link copied to clipboard
open override fun withLogger(logger: YaclaLogger): ConfigLoaderBuilder<T>

Sets the logger used for informational and error messages.