rename static method
Renames property if the target name is not used.
options
configuration optionsfromName
original property name.toName
property name to rename to. return updated configuration options
Implementation
static ConfigParams rename(
ConfigParams options, String fromName, String toName) {
var fromValue = options.getAsObject(fromName);
if (fromValue == null) return options;
var toValue = options.getAsObject(toName);
if (toValue != null) return options;
options = ConfigParams.fromValue(options);
options.setAsObject(toName, fromValue);
options.remove(fromName);
return options;
}