unlockLazy property

Map<K, V> unlockLazy

Unlocks the map, returning a safe, modifiable (mutable) Map.

Using this is very fast at first, since it makes no copies of the IMap entries. However, if and only if you use a method that mutates the map, like add, it will unlock internally (make a copy of all IMap entries). This is transparent to you, and will happen at most only once. In other words, it will unlock the IMap, lazily, only if necessary. If you never mutate the map, it will be very fast to lock this map back into an IMap.

See also: ModifiableMapFromIMap

Implementation

Map<K, V> get unlockLazy => ModifiableMapFromIMap(this);