mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2026-06-04 18:48:20 +08:00
16 lines
523 B
Java
16 lines
523 B
Java
package sample;
|
|
|
|
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() + " !");
|
|
}
|
|
|
|
}
|