toMap method

Map<K, BuiltList<V>> toMap()

Converts to a Map.

Note that the implementation is efficient: it returns a copy-on-write wrapper around the data from this BuiltListMultimap. So, if no mutations are made to the result, no copy is made.

This allows efficient use of APIs that ask for a mutable collection but don't actually mutate it.

Implementation

Map<K, BuiltList<V>> toMap() => CopyOnWriteMap<K, BuiltList<V>>(_map);