/** * Marks all tracked nodes as detached. This method is called if there are * some drastic changes on the underlying node structure, e.g. if the root * node was replaced. * * @return the updated instance */ public NodeTracker detachAllTrackedNodes() { if (trackedNodes.isEmpty()) { // there is not state to be updated return this; } final Map<NodeSelector, TrackedNodeData> newState = new HashMap<>(); for (final Map.Entry<NodeSelector, TrackedNodeData> e : trackedNodes .entrySet()) { final TrackedNodeData newData = e.getValue().isDetached() ? e.getValue() : e.getValue() .detach(null); newState.put(e.getKey(), newData); } return new NodeTracker(newState); }
final Map.Entry<NodeSelector, TrackedNodeData> e) if (e.getValue().isDetached())
/** * Returns a flag whether the specified tracked node is detached. * * @param selector the {@code NodeSelector} * @return a flag whether this node is detached * @throws ConfigurationRuntimeException if no data for this selector is * available */ public boolean isTrackedNodeDetached(final NodeSelector selector) { return getTrackedNodeData(selector).isDetached(); }