Class AnnotatedConfig

java.lang.Object
me.hsgamer.hscore.config.DecorativeConfig
me.hsgamer.hscore.config.annotated.AnnotatedConfig
All Implemented Interfaces:
Config

public class AnnotatedConfig extends DecorativeConfig
The annotated Config, where any fields can be assigned to the config with the annotation ConfigPath. If the field is a final non-static, don't set default value directly, use constructor instead.
 public class ExampleConfig extends AnnotatedConfig {
   @ConfigPath("test1.path")
   private final String test1 = "test1"; // If the field is final, Don't do this
   @ConfigPath("test2.path")
   private final String test2; // Do this instead

   public ExampleConfig(Config config) {
     super(config);
     test2 = "test2"; // Set default value via the constructor
   }
 }
 
  • Constructor Details

    • AnnotatedConfig

      public AnnotatedConfig(Config config)
      Create an annotated config
      Parameters:
      config - the original config
  • Method Details