Added ConfigEntry#hidden()

This commit is contained in:
Florian CUNY 2019-01-03 17:22:05 +01:00
parent 9f676636e0
commit 4a6a109fa4
2 changed files with 11 additions and 0 deletions

View File

@ -17,4 +17,10 @@ public @interface ConfigEntry {
boolean overrideOnChange() default false;
boolean experimental() default false;
boolean needsReset() default false;
/**
* Sets whether this config entry should be printed in the final config file or not.
* @return {@code true} if this config entry should be printed in the final config file, {@code false} otherwise.
*/
boolean hidden() default false;
}

View File

@ -341,6 +341,11 @@ public class YamlDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
if (configEntry != null && !configEntry.path().isEmpty()) {
storageLocation = configEntry.path();
experimental = configEntry.experimental();
if (configEntry.hidden()) {
// If the annotation tells us to not print the config entry, then we won't.
return;
}
}
// Get path for comments