public function getGeneratorClass($type) {
    $type = ucfirst($type);

    if (!isset($this->classes[$type])) {
      $version  = \DrupalCodeBuilder\Factory::getEnvironment()->getCoreMajorVersion();
      $class    = 'DrupalCodeBuilder\\Generator\\' . $type . $version;

      // If there is no version-specific class, use the base class.
      if (!class_exists($class)) {
        $class  = 'DrupalCodeBuilder\\Generator\\' . $type;
      }

      $this->classes[$type] = $class;
    }

    return $this->classes[$type];
  }