Add getOrDefault method for API 23- in plugin lib
This commit is contained in:
@@ -24,6 +24,14 @@ public final class PluginOptions extends HashMap<String, String> {
|
||||
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) {
|
||||
this();
|
||||
if (TextUtils.isEmpty(options)) return;
|
||||
|
||||
Reference in New Issue
Block a user