Returns the value for the key, or the default value if the key is not found.
Example:
var map = new HashMap<string, string> (GLib.str_hash, GLib.str_equal);
map.put ("host", "localhost");
var host = Maps.getOrDefaultString (map, "host", "0.0.0.0");
var port = Maps.getOrDefaultString (map, "port", "8080");
// host == "localhost", port == "8080"
| map |
the source map. |
| key |
the key to look up. |
| defaultValue |
the value to return if key is absent. |
|
the value for the key, or defaultValue. |