added a method getParamOrDefault (to save all that hasParam with subsequent call to getParam)

This commit is contained in:
Maxmtg
2013-04-09 06:36:46 +00:00
parent e66ad294fb
commit 1e38f101d5

View File

@@ -468,6 +468,10 @@ public abstract class SpellAbility implements ISpellAbility {
return this.originalHost; return this.originalHost;
} }
public String getParamOrDefault(String key, String defaultValue) {
return params == null || !params.containsKey(key) ? defaultValue : params.get(key);
}
public String getParam(String key) { public String getParam(String key) {
return params == null ? null : params.get(key); return params == null ? null : params.get(key);
} }