Package io.github.zhengzhengyiyi.config
Class ConfigManager
java.lang.Object
io.github.zhengzhengyiyi.config.ConfigManager
Configuration manager that handles loading, saving, and monitoring configuration files.
Provides static methods for accessing configuration data and automatically reloads
configuration when the file is modified externally.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigDataReturns the current configuration instance.static voidinit()The init methodstatic voidload()Loads configuration from file.static voidsave()Saves current configuration to file.static voidshutdown()Shuts down the file watcher thread.
-
Constructor Details
-
ConfigManager
public ConfigManager()
-
-
Method Details
-
init
public static void init()The init method -
load
public static void load()Loads configuration from file. Creates default configuration if file doesn't exist. -
save
public static void save()Saves current configuration to file. -
getConfig
Returns the current configuration instance.- Returns:
- ConfigData instance containing all configuration values
-
shutdown
public static void shutdown()Shuts down the file watcher thread. Should be called when the application exits.
-