# getGeneric method

ResolvableType getGeneric([

1. List<int>? indexes

])

Returns a ResolvableType representing the generic parameter for the given indexes.

This method retrieves specific generic type parameters from this ResolvableType. For simple cases, it returns the first generic parameter. For complex nested generics, it can navigate through multiple levels using the indexes array.

Parameters:

- `indexes`: Optional list of indexes to navigate nested generics. If null or empty, returns the first generic parameter.

Returns:

- ResolvableType representing the specified generic parameter
- ResolvableType.NONE if the indexes are invalid or no generics exist

Example:

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

    // Simple generic access
    final listGeneric = listType.getGeneric(); // String
    print(listGeneric.resolve()?.getType()); // String

    // Multiple generics
    final mapKey = mapType.getGeneric([0]); // String (first parameter)
    final mapValue = mapType.getGeneric([1]); // int (second parameter)
    print(mapKey.resolve()?.getType()); // String
    print(mapValue.resolve()?.getType()); // int

    // Nested generics
    final nestedValue = nestedType.getGeneric([1]); // List<int>
    final nestedElement = nestedValue.getGeneric([0]); // int
    print(nestedValue.resolve()?.getType()); // List<int>
    print(nestedElement.resolve()?.getType()); // int

    // Invalid access
    final invalid = listType.getGeneric([5]); // ResolvableType.NONE
    print(invalid == ResolvableType.NONE); // true

## Implementation

    ResolvableType getGeneric([List<int>? indexes]) {
      final generics = getGenerics();
      if (indexes == null || indexes.isEmpty) {
        return generics.isEmpty ? NONE : generics[0];
      }

      ResolvableType generic = this;
      for (final index in indexes) {
        final currentGenerics = generic.getGenerics();
        if (index < 0 || index >= currentGenerics.length) {
          return NONE;
        }
        generic = currentGenerics[index];
      }
      return generic;
    }