Class ConfigurationLoader


  • public class ConfigurationLoader
    extends Loader
    CommandManager is used for creating/loading configuration file by loading class annotated with Configuration Each field in the class will be loaded from the file created/loaded
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigurationLoader​(@NotNull org.bukkit.plugin.Plugin plugin)
      Default constructor
    • Constructor Detail

      • ConfigurationLoader

        public ConfigurationLoader​(@NotNull
                                   @NotNull org.bukkit.plugin.Plugin plugin)
        Default constructor
        Parameters:
        plugin - Instance of your plugin
    • Method Detail

      • excludeFieldsWithoutManageAnnotation

        @NotNull
        public @NotNull ConfigurationLoader excludeFieldsWithoutManageAnnotation()
        This method is used for excluding all fields in the classes who don't have the Manage annotation
        Returns:
        The current instance
      • load

        @NotNull
        public <T> T load​(@NotNull
                          T obj)
        This method will load all the field in the object in parameter If excludeFieldsWithoutManageAnnotation() has been called before All the fields without this annotation will be ignored
        Specified by:
        load in class Loader
        Type Parameters:
        T - Type of the object to load
        Parameters:
        obj - Object to load
        Returns:
        The object loaded
      • save

        public void save​(@NotNull
                         @NotNull java.lang.Object obj)
        This method will save all the field of the object in the file If excludeFieldsWithoutManageAnnotation() has been called before All the fields without this annotation will be ignored
        Parameters:
        obj - Object to save