Class SimpleConfig<T extends org.simpleyaml.configuration.file.FileConfiguration>

java.lang.Object
me.hsgamer.hscore.config.simpleconfiguration.SimpleConfig<T>
All Implemented Interfaces:
Config

public class SimpleConfig<T extends org.simpleyaml.configuration.file.FileConfiguration> extends Object implements Config
The Config implementation for SimpleYAML
  • Field Details

    • loader

      protected final BiConsumer<File,T extends org.simpleyaml.configuration.file.FileConfiguration> loader
  • Constructor Details

    • SimpleConfig

      public SimpleConfig(File file, T configuration, BiConsumer<File,T> loader)
      Create a new config
      Parameters:
      file - the file
      configuration - the configuration
      loader - the loader
    • SimpleConfig

      public SimpleConfig(File file, T configuration)
      Create a new config
      Parameters:
      file - the file
      configuration - the configuration
  • Method Details

    • getOriginal

      public org.simpleyaml.configuration.file.FileConfiguration getOriginal()
      Description copied from interface: Config
      Get the original instance
      Specified by:
      getOriginal in interface Config
      Returns:
      the original instance
    • get

      public Object get(Object def, String... path)
      Description copied from interface: Config
      Get the value from the path
      Specified by:
      get in interface Config
      Parameters:
      def - the default value if the value is not found
      path - the path
      Returns:
      the value
    • set

      public void set(Object value, String... path)
      Description copied from interface: Config
      Set the value to the path
      Specified by:
      set in interface Config
      Parameters:
      value - the value
      path - the path
    • contains

      public boolean contains(String... path)
      Description copied from interface: Config
      Check if the configuration contains the path
      Specified by:
      contains in interface Config
      Parameters:
      path - the path
      Returns:
      true if it does
    • getName

      public String getName()
      Description copied from interface: Config
      Get the name of the configuration
      Specified by:
      getName in interface Config
      Returns:
      the name
    • getValues

      public Map<String[],Object> getValues(boolean deep, String... path)
      Description copied from interface: Config
      Get all values from the path
      Specified by:
      getValues in interface Config
      Parameters:
      deep - should we go deeper from the path?
      path - the path
      Returns:
      the values
    • setup

      public void setup()
      Description copied from interface: Config
      Set up the configuration
      Specified by:
      setup in interface Config
    • save

      public void save()
      Description copied from interface: Config
      Save the configuration
      Specified by:
      save in interface Config
    • reload

      public void reload()
      Description copied from interface: Config
      Reload the configuration
      Specified by:
      reload in interface Config
    • normalize

      public Object normalize(Object object)
      Description copied from interface: Config
      Normalize the library-specific object
      Specified by:
      normalize in interface Config
      Parameters:
      object - the object
      Returns:
      the normalized object
    • isNormalizable

      public boolean isNormalizable(Object object)
      Description copied from interface: Config
      Check if the object is normalizable
      Specified by:
      isNormalizable in interface Config
      Parameters:
      object - the object
      Returns:
      true if it is
    • getComment

      public List<String> getComment(CommentType type, String... path)
      Description copied from interface: Config
      Get the comment. This is a default empty method. The implementation can override this method to support comments.
      Specified by:
      getComment in interface Config
      Parameters:
      type - the comment type
      path - the path
      Returns:
      the comment
    • setComment

      public void setComment(CommentType type, List<String> value, String... path)
      Description copied from interface: Config
      Set the comment This is a default empty method. The implementation can override this method to support comments.
      Specified by:
      setComment in interface Config
      Parameters:
      type - the comment type
      value - the comment, can be null to remove the comment
      path - the path