X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fpersisted%2FModifiedDataTreeCandidateNode.java;h=8c771886f815e6adccfbab28cf892ff51afb1847;hb=HEAD;hp=59d03d465e203cee23ef4cf3f06717cbbd35dd2b;hpb=175f38490b56c4b4e0ec356b17b91f887b295da4;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ModifiedDataTreeCandidateNode.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ModifiedDataTreeCandidateNode.java index 59d03d465e..8c771886f8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ModifiedDataTreeCandidateNode.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ModifiedDataTreeCandidateNode.java @@ -7,51 +7,54 @@ */ package org.opendaylight.controller.cluster.datastore.persisted; -import com.google.common.base.Optional; -import com.google.common.base.Preconditions; +import static java.util.Objects.requireNonNull; + import java.util.Collection; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode; -import org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType; +import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode; +import org.opendaylight.yangtools.yang.data.tree.api.ModificationType; /** * A deserialized {@link DataTreeCandidateNode} which represents a modification in * one of its children. */ abstract class ModifiedDataTreeCandidateNode extends AbstractDataTreeCandidateNode { - private final Collection children; + private final @NonNull Collection children; - private ModifiedDataTreeCandidateNode(final ModificationType type, final Collection children) { + private ModifiedDataTreeCandidateNode(final ModificationType type, + final Collection children) { super(type); - this.children = Preconditions.checkNotNull(children); + this.children = requireNonNull(children); } - static DataTreeCandidateNode create(final Collection children) { - return new ModifiedDataTreeCandidateNode(ModificationType.SUBTREE_MODIFIED, children) { + static DataTreeCandidateNode create(final ModificationType type, final Collection children) { + return new ModifiedDataTreeCandidateNode(type, children) { @Override - public PathArgument getIdentifier() { + public PathArgument name() { throw new UnsupportedOperationException("Root node does not have an identifier"); } }; } - static DataTreeCandidateNode create(final PathArgument identifier, final ModificationType type, final Collection children) { + static DataTreeCandidateNode create(final PathArgument identifier, final ModificationType type, + final Collection children) { return new ModifiedDataTreeCandidateNode(type, children) { @Override - public final PathArgument getIdentifier() { + public PathArgument name() { return identifier; } }; } @Override - public final Optional> getDataAfter() { + public final NormalizedNode dataAfter() { throw new UnsupportedOperationException("After-image not available after serialization"); } @Override - public final Collection getChildNodes() { + public final Collection childNodes() { return children; } }