Class Config

java.lang.Object
com.fancyinnovations.config.Config

public class Config extends Object
Represents a configuration manager that handles loading, saving, and managing configuration fields. It uses YAML files for storage and provides methods to add fields, retrieve values, and reload configurations.
  • Constructor Details

    • Config

      public Config(de.oliver.fancyanalytics.logger.ExtendedFancyLogger logger, String configFilePath)
  • Method Details

    • addField

      public void addField(ConfigField<?> field)
      Adds a configuration field to the manager.
      Parameters:
      field - the configuration field to add
    • getFields

      public Map<String,ConfigField<?>> getFields()
      Retrieves the logger associated with this configuration.
      Returns:
      the logger
    • get

      public <T> T get(String path)
      Retrieves the value of a configuration field by its path.
      Type Parameters:
      T - the type of the field value
      Parameters:
      path - the path of the configuration field
      Returns:
      the value of the configuration field or null if not found
    • reload

      public void reload()
      Reloads the configuration from the file.