save

fun <T : Any> save(file: File, instance: T)

Saves a configuration instance to the specified file in YAML format.

The instance is serialized using Serializer, @Comment annotations are extracted via CommentExtractor, and the output is written by YamlWriter. Parent directories are created automatically if they do not exist.

Example:

val config = ServerConfig(host = "0.0.0.0", port = 9090)
YamlConfigManager.save(dataFolder.resolve("config.yml"), config)

Since

1.0

Parameters

T

The configuration type.

file

The target YAML file to write to.

instance

The configuration instance to serialize and save.

See also