package org.opendaylight.controller.md.sal.common.impl.service; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import org.opendaylight.yangtools.concepts.Path; public class RootedChangeSet

,D> { private final P root; private final Map original; private final Map created = new HashMap<>(); private final Map updated = new HashMap<>(); private final Set

removed = new HashSet<>(); public RootedChangeSet(P root,Map original) { super(); this.root = root; this.original = original; } protected P getRoot() { return root; } protected Map getOriginal() { return original; } protected Map getCreated() { return created; } protected Map getUpdated() { return updated; } protected Set

getRemoved() { return removed; } public void addCreated(Map created) { this.created.putAll(created); } public void addCreated(Entry entry) { created.put(entry.getKey(), entry.getValue()); } public void addUpdated(Entry entry) { updated.put(entry.getKey(), entry.getValue()); } public void addRemoval(P path) { removed.add(path); } public boolean isChange() { return !created.isEmpty() || !updated.isEmpty() || !removed.isEmpty(); } }