Class StrategiesRegistry


  • public final class StrategiesRegistry
    extends Object
    The StrategiesRegistry class is used to store initialized strategies for lookup during the prototype's execution.
    • Method Detail

      • getInstance

        public static StrategiesRegistry getInstance()
        Gets the instance of the strategies registry.
        Returns:
        the instance of the strategies registry
      • registerStrategy

        public void registerStrategy​(ResourceTypeEnum resourceType,
                                     IDemandStrategy strategy)
        Registers a strategy.
        Parameters:
        resourceType - the type of the strategy
        strategy - the strategy to register
      • getStrategy

        public IDemandStrategy getStrategy​(ResourceTypeEnum resourceType)
        Gets a registered strategy of the specified type.
        Parameters:
        resourceType - the type of strategy to retrieve
        Returns:
        a registered strategy of the specified type