net.lenni0451.optconfig.annotations.OptConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of optconfig Show documentation
Show all versions of optconfig Show documentation
A java library for parsing yaml config files with support for comments and default values
The newest version!
package net.lenni0451.optconfig.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Mark a class as an OptConfig class.
* This annotation is required to use the OptConfig API.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface OptConfig {
int DEFAULT_VERSION = 1;
String CONFIG_VERSION_OPTION = "config-version";
/**
* Get the version of the configuration.
* If a version mismatch is detected, the migrator will be called.
* If no migrator is set, the default values will be used for new options and old options will be removed.
*
* @return The version of the configuration
*/
int version() default DEFAULT_VERSION;
/**
* Get the header of the configuration file.
* This header will be written at the top of the configuration file.
* A new line will be added automatically below the header.
*
* @return The header of the configuration file
*/
String[] header() default {};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy