properties.clear(); for (Entry<String, MutableNodeState> entry : nodes.entrySet()) { entry.getValue().reset(base.getChildNode(entry.getKey()));
properties.clear(); for (Entry<String, MutableNodeState> entry : nodes.entrySet()) { entry.getValue().reset(base.getChildNode(entry.getKey()));
/** * Remove the child node with the given {@code name}. * @param name name of the child node to remove * @return {@code true} if a child node {@code name} existed, {@code false} otherwise. */ boolean removeChildNode(String name) { assert base != null; MutableNodeState child = nodes.get(name); if (child != null) { boolean existed = child.exists(); child.reset(MISSING_NODE); return existed; } else { nodes.put(name, new MutableNodeState(MISSING_NODE)); return base.hasChildNode(name); } }
/** * Remove the child node with the given {@code name}. * @param name name of the child node to remove * @return {@code true} if a child node {@code name} existed, {@code false} otherwise. */ boolean removeChildNode(String name) { assert base != null; MutableNodeState child = nodes.get(name); if (child != null) { boolean existed = child.exists(); child.reset(MISSING_NODE); return existed; } else { nodes.put(name, new MutableNodeState(MISSING_NODE)); return base.hasChildNode(name); } }
/** * Equivalent to * <pre> * MutableNodeState child = getChildNode(name, true); * child.reset(state); * return child; * </pre> * * @throws IllegalArgumentException if the given name string is empty * or contains the forward slash character */ @NotNull MutableNodeState setChildNode(String name, NodeState state) throws IllegalArgumentException { assert base != null; MutableNodeState child = nodes.get(name); if (child == null) { checkValidName(name); child = new MutableNodeState(state); if (base.hasChildNode(name)) { child.replaced = true; } nodes.put(name, child); } else { child.replaced = true; child.reset(state); } return child; }
/** * Equivalent to * <pre> * MutableNodeState child = getChildNode(name, true); * child.reset(state); * return child; * </pre> * * @throws IllegalArgumentException if the given name string is empty * or contains the forward slash character */ @Nonnull MutableNodeState setChildNode(String name, NodeState state) throws IllegalArgumentException { assert base != null; MutableNodeState child = nodes.get(name); if (child == null) { checkValidName(name); child = new MutableNodeState(state); if (base.hasChildNode(name)) { child.replaced = true; } nodes.put(name, child); } else { child.replaced = true; child.reset(state); } return child; }