____ _____ ____ __ _
/ __/__ ____ __ __ / ___/__ ___ / _(_)__ ___ _________ _/ /_(_)__ ___
/ _// _ `(_-</ // / / /__/ _ \/ _ \/ _/ / _ `/ // / __/ _ `/ __/ / _ \/ _ \
/___/\_,_/___/\_, / \___/\___/_//_/_//_/\_, /\_,_/_/ \_,_/\__/_/\___/_//_/
/___/ /___/
README LANGUAGES [ English | 中文 ]
Easy (to make) Configurations!
A simple, easy-to-use and universal solution for managing configuration files. Enjoy the ease of use with customizable formats for loading, reading, and updating your configuration files.
Supported YAML, JSON, HOCON and SQL based configuration files format.
ConfigValue<?>
objects.For the latest JavaDoc release, CLICK HERE.
For a detailed development guide, CLICK HERE.
To quickly demonstrate the applicability of the project, here are a few practical demonstrations:
Check out all code demonstrations HERE. For more examples, see the Development Guide.
@HeaderComment("Configurations for sample")
interface SampleConfig extends Configuration {
@InlineComment("Enabled?") // Inline comment
ConfiguredValue<Boolean> ENABLED = ConfiguredValue.of(true);
ConfiguredList<UUID> UUIDS = ConfiguredList.builderOf(UUID.class).fromString()
.parseValue(UUID::fromString).serializeValue(UUID::toString)
.defaults(
UUID.fromString("00000000-0000-0000-0000-000000000000"),
UUID.fromString("00000000-0000-0000-0000-000000000001")
).build();
interface INFO extends Configuration {
@HeaderComment("Configure your name!") // Header comment
ConfiguredValue<String> NAME = ConfiguredValue.of("Joker");
@ConfigPath("year") // Custom path
ConfiguredValue<Integer> AGE = ConfiguredValue.of(24);
}
}
public class Sample {
public static void main(String[] args) {
// 1. Make a configuration provider from a file.
ConfigurationProvider<?> provider = EasyConfiguration.from("config.yml");
// 2. Initialize the configuration classes or instances.
provider.initialize(SampleConfig.class);
// 3. Enjoy using the configuration!
SampleConfig.ENABLED.set(false);
System.out.println("Your name is " + SampleConfig.INFO.NAME.getNotNull() + " !");
}
}
# Configurations for sample
enabled: true # Enabled?
uuids:
- 00000000-0000-0000-0000-000000000000
- 00000000-0000-0000-0000-000000000001
info:
# Configure your name!
name: Joker
year: 24
EasyConfiguration for MineCraft! Easily manage configurations on MineCraft-related server platforms.
Currently supports BungeeCord, Bukkit (Spigot) servers, with more platforms to be supported soon.
If you appreciate this plugin, consider supporting me with a donation!
Thank you for supporting open-source projects!
Many thanks to Jetbrains for kindly providing a license for us to work on this and other open-source projects.
This project's source code is licensed under the GNU LESSER GENERAL PUBLIC LICENSE.