# findTypeParameters method

1. @override

List<Class> findTypeParameters(

1. Class parentClass

)
override

Finds the type parameters of a generic class.

Parameters:

- `parentClass`: The class representing the generic type.

Returns:

- A list of Class instances representing the type parameters.

## Example

    final listClass = await loader.loadClass<List<String>>('dart:core/list.dart.List');
    final typeParams = loader.findTypeParameters(listClass);
    print(typeParams.map((arg) => arg.qualifiedName)); // e.g., ["dart:core/string.dart.String"]

## Implementation

    @override
    List<Class> findTypeParameters(Class parentClass) {
      _checkClosed();

      final cacheKey = "${_buildCacheKey(parentClass)}:typeParameters";

      // Check cache first
      final cached = _typeParameterCache[cacheKey];
      if (cached != null) {
        _hitCount++;
        return List.from(cached);
      }

      _missCount++;

      // Compute classes
      final args = parentClass.getTypeDeclaration().getTypeArguments();
      final classes = args.map((tp) => _getFromLink(tp, parentClass.getProtectionDomain(), useType: true)).toList();

      // Cache result
      _typeParameterCache[cacheKey] = classes;

      return List.from(classes);
    }