Package com.fancyinnovations.config
Class Config
java.lang.Object
com.fancyinnovations.config.Config
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddField(ConfigField<?> field) Adds a configuration field to the manager.<T> TRetrieves the value of a configuration field by its path.Map<String,ConfigField<?>> Retrieves the logger associated with this configuration.voidreload()Reloads the configuration from the file.
-
Constructor Details
-
Config
-
-
Method Details
-
addField
Adds a configuration field to the manager.- Parameters:
field- the configuration field to add
-
getFields
Retrieves the logger associated with this configuration.- Returns:
- the logger
-
get
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.
-