Package me.a8kj.config
Class ConfigProvider
java.lang.Object
me.a8kj.config.ConfigProvider
A static provider class that acts as a global access point for the
ConfigAPI.
This class ensures that the API is initialized once and remains accessible throughout the application lifecycle.- Since:
- 0.1
- Author:
- a8kj7sea
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ConfigProvider
public ConfigProvider()
-
-
Method Details
-
load
Initializes the provider with a specific API implementation. This method must be called only once during the application startup.- Parameters:
api- theConfigAPIimplementation to load.- Throws:
IllegalStateException- if the API has already been loaded.- Since:
- 0.1
-
provide
Retrieves the currently loaded API implementation.- Returns:
- the active
ConfigAPIinstance. - Throws:
IllegalStateException- if the API has not been initialized yet.- Since:
- 0.1
-