Page cover

Single Type Config Directory

A directory of configuration files that store a single type of class.

public class Example implements ConfigurationConvertible<Example> {
        
        public String string;

        @Override
        public @NotNull ConfigurationSection convert() {
            ConfigurationSection section = new MemoryConfigurationSection();
            section.set("string", string);
            return section;
        }

        @Override
        public @NotNull Example convert(@NotNull ConfigurationSection section) {
            this.string = section.getString("string");
            return this;
        }
}
SingleTypeConfigurationDirectory<Example> directory 
        = new SingleTypeConfigurationDirectory<>(
        
    new File(""),
    identifier -> new Example(),
    false
);

Last updated