Returns a new map with keys and values swapped. If multiple entries have the same value, later entries overwrite earlier ones in the result unless conflict resolver is provided.
Example:
var map = new HashMap<string, string> (GLib.str_hash, GLib.str_equal);
map.put ("a", "1");
map.put ("b", "2");
var inv = Maps.invertString (map);
// inv["1"] == "a", inv["2"] == "b"
| map |
the source map. |
| on_conflict |
optional resolver for value-key collisions. |
|
a new HashMap with keys and values swapped. |