Class ConfigProvider

java.lang.Object
me.a8kj.config.ConfigProvider

public final class ConfigProvider extends Object
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 Details

    • ConfigProvider

      public ConfigProvider()
  • Method Details

    • load

      public static void load(ConfigAPI api)
      Initializes the provider with a specific API implementation. This method must be called only once during the application startup.
      Parameters:
      api - the ConfigAPI implementation to load.
      Throws:
      IllegalStateException - if the API has already been loaded.
      Since:
      0.1
    • provide

      public static ConfigAPI provide()
      Retrieves the currently loaded API implementation.
      Returns:
      the active ConfigAPI instance.
      Throws:
      IllegalStateException - if the API has not been initialized yet.
      Since:
      0.1