Commit 55667c9e authored by Mygod's avatar Mygod

Add getOrDefault method for API 23- in plugin lib

parent e81c4f25
...@@ -24,6 +24,14 @@ public final class PluginOptions extends HashMap<String, String> { ...@@ -24,6 +24,14 @@ public final class PluginOptions extends HashMap<String, String> {
super(initialCapacity, loadFactor); super(initialCapacity, loadFactor);
} }
// TODO: this method is not needed since API 24
public String getOrDefault(Object key, String defaultValue) {
String v;
return (((v = get(key)) != null) || containsKey(key))
? v
: defaultValue;
}
private PluginOptions(String options, boolean parseId) { private PluginOptions(String options, boolean parseId) {
this(); this();
if (TextUtils.isEmpty(options)) return; if (TextUtils.isEmpty(options)) return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment