setStrategy method

void setStrategy(
  1. String strategy
)

Changes the active strategy after validating it.

Throws an ArgumentError if strategy is not supported.

Implementation

void setStrategy(String strategy) {
  if (!supportedStrategies.contains(strategy)) {
    throw ArgumentError(
      'Unsupported reprovide strategy: $strategy. '
      'Supported strategies: $supportedStrategies',
    );
  }
  _strategy = strategy;
  _logger.info('Reprovider strategy changed to $strategy');
}