Getting started
Learn the basic setup steps for managing configuration files. This library makes loading and saving configurations easy.
Define config data class
Define a data class to store your configuration data, corresponding to your configuration file parameters.
Please read Define data class for more details.
Load / Save
Methods for loading and saving configuration files.
Load config from plugin file
Load the configuration from a plugin file. Returns null
if the file is missing or its content is empty.
Load the configuration with a default value. If the file is missing or its content is empty, the function saves the default value to the file and returns it.
Load config from file
Load the configuration from a general file. Returns null
if the file is missing or its content is empty.
Load the configuration with a default value. If the file is missing or its content is empty, the function saves the default value to the file and returns it.
Load config from text
Load the configuration from a YAML string. Returns null
if the string is empty.
Save config to plugin file
Save the configuration to a plugin file.
Save config to file
Save the configuration to a specified file.
Save config to text
Convert the configuration to a YAML string. This is useful for storing or transmitting the configuration as a string.