# getGenerics method

List<ResolvableType> getGenerics()

Returns an array of ResolvableTypes representing the generic parameters of this type.

This method returns all generic type parameters for this ResolvableType. For example, for `Map<String, int>`, this would return ResolvableType(String), ResolvableType(int).

Returns:

- List of ResolvableType instances representing all generic parameters
- Empty list if this type has no generic parameters

Example:

    final stringType = ResolvableType.forClass(String);
    final listType = ResolvableType.forClass(List<String>);
    final mapType = ResolvableType.forClass(Map<String, int>);

    final stringGenerics = stringType.getGenerics();
    print(stringGenerics.length); // 0

    final listGenerics = listType.getGenerics();
    print(listGenerics.length); // 1
    print(listGenerics[0].resolve()?.getType()); // String

    final mapGenerics = mapType.getGenerics();
    print(mapGenerics.length); // 2
    print(mapGenerics[0].resolve()?.getType()); // String
    print(mapGenerics[1].resolve()?.getType()); // int

    // Iterate through all generics
    void printGenerics(ResolvableType type) {
      final generics = type.getGenerics();
      for (int i = 0; i < generics.length; i++) {
        print("Generic $i: ${generics[i].resolve()?.getType()}");
      }
    }

## Implementation

    List<ResolvableType> getGenerics() {
      if (this == NONE) return _EMPTY_TYPES_ARRAY;

      List<ResolvableType>? generics = _generics;
      if (generics == null) {
        final resolved = resolve();
        if (resolved != null) {
          final declaration = TypeDiscovery.findByQualifiedName(resolved.getQualifiedName());
          if (declaration != null) {
            final typeArgs = declaration.getTypeArguments();
            if (typeArgs.isNotEmpty) {
              generics = typeArgs.map((arg) => forType(arg.getType(), this)).toList();
            } else {
              generics = _EMPTY_TYPES_ARRAY;
            }
          } else {
            generics = _EMPTY_TYPES_ARRAY;
          }
        } else {
          generics = resolveType().getGenerics();
        }
        _generics = generics;
      }
      return generics;
    }