private ConfigOverlay applyUnset(CommandOperation op, ConfigOverlay overlay) { List<String> name = op.getStrs(CommandOperation.ROOT_OBJ); if (op.hasError()) return overlay; for (String o : name) { if (!ConfigOverlay.isEditableProp(o, false, null)) { op.addError(format(NOT_EDITABLE, name)); } else { overlay = overlay.unsetProperty(o); } } return overlay; }
private ConfigOverlay applySetProp(CommandOperation op, ConfigOverlay overlay) { Map<String, Object> m = op.getDataMap(); if (op.hasError()) return overlay; for (Map.Entry<String, Object> e : m.entrySet()) { String name = e.getKey(); Object val = e.getValue(); if (!ConfigOverlay.isEditableProp(name, false, null)) { op.addError(format(NOT_EDITABLE, name)); continue; } overlay = overlay.setProperty(name, val); } return overlay; }