# asMap method

ResolvableType asMap()

Returns this type as a resolvable Map type.

This convenience method attempts to view this ResolvableType as a Map. If this type implements or extends Map, it returns the appropriate ResolvableType. Otherwise, it returns ResolvableType.NONE.

Returns:

- ResolvableType representing this type as a Map
- ResolvableType.NONE if this type is not a Map

Example:

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

    final mapAsMap = mapType.asMap();
    print(mapAsMap != ResolvableType.NONE); // true

    final listAsMap = listType.asMap();
    print(listAsMap == ResolvableType.NONE); // true

    // Useful for Map-specific processing
    void processIfMap(ResolvableType type) {
      final asMap = type.asMap();
      if (asMap != ResolvableType.NONE) {
        final keyType = asMap.getKeyType();
        final valueType = asMap.getGeneric([1]);
        print("Map with keys: ${keyType.resolve()?.getType()}");
        print("Map with values: ${valueType.resolve()?.getType()}");
      }
    }

## Implementation

    ResolvableType asMap() => as(Map);