X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2Ftree%2FTreeNodeUtils.java;h=99982d318cf5487699d2db60549e4ee194ed0540;hb=c22465be2000037e89ec812f901fe7f608e58093;hp=339d9cb44e2ed9515daa1eabbb8db2d913dab91a;hpb=f776809962df87deeaa533ba995cc6fceba64d0e;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java index 339d9cb44e..99982d318c 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/TreeNodeUtils.java @@ -13,6 +13,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.TreeNode; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; @@ -21,7 +22,13 @@ import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.base.Predicates; -public class TreeNodeUtils { +/** + * A set of utility methods for interacting with {@link TreeNode} objects. + */ +public final class TreeNodeUtils { + private TreeNodeUtils() { + throw new UnsupportedOperationException("Utility class should not be instantiated"); + } /** * Finds a node in tree @@ -29,7 +36,6 @@ public class TreeNodeUtils { * @param tree Data Tree * @param path Path to the node * @return Optional with node if the node is present in tree, {@link Optional#absent()} otherwise. - * */ public static > Optional findNode(final T tree, final InstanceIdentifier path) { Optional current = Optional. of(tree); @@ -40,7 +46,6 @@ public class TreeNodeUtils { return current; } - public static > T findNodeChecked(final T tree, final InstanceIdentifier path) { T current = tree; List nested = new ArrayList<>(path.getPath().size());