Class ScalingRegistryHolder

java.lang.Object
io.artificial.enchantments.internal.scaling.ScalingRegistryHolder

public final class ScalingRegistryHolder extends Object
Holder for the scaling algorithm registry instance.

This class provides access to the registry for internal components without making it a global static singleton. The registry is set during API initialization and remains immutable thereafter.

Since:
0.2.0
  • Method Details

    • initialize

      public static void initialize(ScalingAlgorithmRegistry registryInstance)
      Initializes the holder with the registry instance.

      This should be called once during API initialization.

      Parameters:
      registryInstance - the registry instance to use
      Throws:
      IllegalStateException - if already initialized
    • getRegistry

      public static ScalingAlgorithmRegistry getRegistry()
      Gets the registry instance.

      If not initialized, returns a default registry.

      Returns:
      the registry instance
    • isInitialized

      public static boolean isInitialized()
      Checks if the holder has been initialized.
      Returns:
      true if initialized