From 30b223a20b7a10ddab42115eee15d7552477f752 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 29 Jul 2014 12:13:03 +0200 Subject: [PATCH] BUG-1092: rename data.api.InstanceIdentifier to YangInstanceIdentifier On popular request to clear up confusion between yang.binding.InstanceIdentifier and yang.data.api.InstanceIdentifier, we rename the latter (which is the low-level one). This will make it clear for users of GUIs, who were confused by the tools giving them the choice between the two. Change-Id: I1e30a0df93d8bfb891d047c58abcb117d4006c76 Signed-off-by: Robert Varga --- .../impl/InstanceIdentifierCodecImpl.java | 22 +++--- .../impl/LazyGeneratedCodecRegistry.java | 2 +- .../RuntimeGeneratedMappingServiceImpl.java | 22 +++--- .../unified/doc/generator/GeneratorImpl.xtend | 72 +++++++++---------- ...AugmentationWithGroupingsAndCasesTest.java | 2 +- .../restconf/utils/RestconfUtils.java | 24 +++---- .../yangtools/restconf/utils/Bug1196Test.java | 4 +- ...ifier.java => YangInstanceIdentifier.java} | 48 ++++++------- .../api/codec/InstanceIdentifierCodec.java | 8 +-- .../yang/data/api/schema/AnyXmlNode.java | 2 +- .../data/api/schema/AugmentationNode.java | 8 +-- .../yang/data/api/schema/ChoiceNode.java | 4 +- .../yang/data/api/schema/ContainerNode.java | 4 +- .../data/api/schema/DataContainerChild.java | 2 +- .../data/api/schema/DataContainerNode.java | 2 +- .../yang/data/api/schema/LeafNode.java | 2 +- .../data/api/schema/LeafSetEntryNode.java | 2 +- .../yang/data/api/schema/LeafSetNode.java | 4 +- .../yang/data/api/schema/MapEntryNode.java | 6 +- .../yang/data/api/schema/MapNode.java | 4 +- .../yang/data/api/schema/NormalizedNode.java | 6 +- .../api/schema/NormalizedNodeContainer.java | 2 +- .../data/api/schema/OrderedNodeContainer.java | 2 +- .../data/api/schema/UnkeyedListEntryNode.java | 2 +- .../yang/data/api/schema/UnkeyedListNode.java | 2 +- .../yang/data/api/schema/package-info.java | 20 +++--- ...nflictingModificationAppliedException.java | 6 +- .../api/schema/tree/DataTreeCandidate.java | 4 +- .../schema/tree/DataTreeCandidateNode.java | 2 +- .../api/schema/tree/DataTreeModification.java | 8 +-- .../api/schema/tree/DataTreeSnapshot.java | 4 +- .../tree/DataValidationFailedException.java | 10 +-- .../tree/IncorrectDataStructureException.java | 6 +- .../ModifiedNodeDoesNotExistException.java | 6 +- .../data/api/schema/tree/StoreTreeNode.java | 2 +- .../api/schema/tree/spi/AbstractTreeNode.java | 2 +- .../api/schema/tree/spi/ContainerNode.java | 2 +- .../api/schema/tree/spi/MutableTreeNode.java | 2 +- .../data/api/schema/tree/spi/TreeNode.java | 2 +- .../data/api/schema/tree/spi/ValueNode.java | 2 +- .../yang/data/api/InstanceIdentifierTest.java | 46 ++++++------ .../BindingIndependentMappingService.java | 6 +- .../impl/codec/InstanceIdentifierCodec.java | 6 +- .../xml/InstanceIdentifierForXmlCodec.java | 14 ++-- .../data/impl/codec/xml/XmlStreamUtils.java | 8 +-- .../yang/data/impl/codec/xml/XmlUtils.java | 10 +-- .../yang/data/impl/schema/Builders.java | 36 +++++----- .../yang/data/impl/schema/ImmutableNodes.java | 4 +- .../data/impl/schema/NormalizedNodeUtils.java | 14 ++-- .../yang/data/impl/schema/SchemaUtils.java | 10 +-- .../builder/api/CollectionNodeBuilder.java | 12 ++-- .../api/DataContainerNodeAttrBuilder.java | 6 +- .../builder/api/DataContainerNodeBuilder.java | 8 +-- .../schema/builder/api/ListNodeBuilder.java | 6 +- .../api/NormalizedNodeAttrBuilder.java | 4 +- .../builder/api/NormalizedNodeBuilder.java | 4 +- .../api/NormalizedNodeContainerBuilder.java | 2 +- ...ImmutableDataContainerNodeAttrBuilder.java | 6 +- ...ractImmutableDataContainerNodeBuilder.java | 12 ++-- ...bstractImmutableNormalizedNodeBuilder.java | 4 +- .../impl/ImmutableAnyXmlNodeBuilder.java | 10 +-- ...ImmutableAnyXmlNodeSchemaAwareBuilder.java | 10 +-- .../ImmutableAugmentationNodeBuilder.java | 18 ++--- ...bleAugmentationNodeSchemaAwareBuilder.java | 8 +-- .../impl/ImmutableChoiceNodeBuilder.java | 14 ++-- ...ImmutableChoiceNodeSchemaAwareBuilder.java | 10 +-- .../impl/ImmutableContainerNodeBuilder.java | 14 ++-- ...utableContainerNodeSchemaAwareBuilder.java | 14 ++-- .../impl/ImmutableLeafNodeBuilder.java | 10 +-- .../ImmutableLeafNodeSchemaAwareBuilder.java | 10 +-- .../ImmutableLeafSetEntryNodeBuilder.java | 8 +-- ...bleLeafSetEntryNodeSchemaAwareBuilder.java | 10 +-- .../impl/ImmutableLeafSetNodeBuilder.java | 24 +++---- ...mmutableLeafSetNodeSchemaAwareBuilder.java | 8 +-- .../impl/ImmutableMapEntryNodeBuilder.java | 30 ++++---- ...mutableMapEntryNodeSchemaAwareBuilder.java | 14 ++-- .../builder/impl/ImmutableMapNodeBuilder.java | 24 +++---- .../ImmutableMapNodeSchemaAwareBuilder.java | 8 +-- .../ImmutableOrderedLeafSetNodeBuilder.java | 26 +++---- .../impl/ImmutableOrderedMapNodeBuilder.java | 24 +++---- .../ImmutableUnkeyedListEntryNodeBuilder.java | 14 ++-- .../impl/ImmutableUnkeyedListNodeBuilder.java | 16 ++--- .../valid/DataNodeContainerValidator.java | 10 +-- .../impl/valid/DataValidationException.java | 26 +++---- ...bstractImmutableDataContainerAttrNode.java | 6 +- .../AbstractImmutableDataContainerNode.java | 2 +- .../AbstractImmutableNormalizedNode.java | 4 +- ...tractImmutableNormalizedValueAttrNode.java | 4 +- .../AbstractImmutableNormalizedValueNode.java | 4 +- .../parser/AugmentationNodeBaseParser.java | 4 +- .../base/parser/BaseDispatcherParser.java | 4 +- .../base/parser/ChoiceNodeBaseParser.java | 4 +- .../base/parser/ContainerNodeBaseParser.java | 4 +- .../base/parser/LeafNodeBaseParser.java | 4 +- .../parser/LeafSetEntryNodeBaseParser.java | 4 +- .../base/parser/MapEntryNodeBaseParser.java | 4 +- .../AugmentationNodeBaseSerializer.java | 4 +- .../serializer/BaseDispatcherSerializer.java | 6 +- .../serializer/ChoiceNodeBaseSerializer.java | 4 +- .../ContainerNodeBaseSerializer.java | 4 +- .../MapEntryNodeBaseSerializer.java | 4 +- .../serializer/NodeSerializerDispatcher.java | 22 +++--- .../tree/AbstractDataTreeCandidate.java | 8 +-- .../impl/schema/tree/AlwaysFailOperation.java | 6 +- ...DataNodeContainerModificationStrategy.java | 4 +- .../impl/schema/tree/InMemoryDataTree.java | 4 +- .../tree/InMemoryDataTreeCandidate.java | 6 +- .../schema/tree/InMemoryDataTreeFactory.java | 2 +- .../tree/InMemoryDataTreeModification.java | 22 +++--- .../schema/tree/InMemoryDataTreeSnapshot.java | 4 +- .../tree/ModificationApplyOperation.java | 6 +- .../data/impl/schema/tree/ModifiedNode.java | 2 +- .../impl/schema/tree/NodeModification.java | 2 +- .../schema/tree/NoopDataTreeCandidate.java | 6 +- ...izedNodeContainerModificationStrategy.java | 22 +++--- .../tree/OperationWithModification.java | 2 +- .../tree/RootModificationApplyOperation.java | 6 +- .../tree/SchemaAwareApplyOperation.java | 22 +++--- .../data/impl/schema/tree/StoreUtils.java | 6 +- .../data/impl/schema/tree/TreeNodeUtils.java | 20 +++--- .../tree/ValueNodeModificationStrategy.java | 6 +- .../impl/codec/xml/XmlDocumentUtilsTest.java | 4 +- .../schema/NormalizedDataBuilderTest.java | 18 ++--- .../schema/test/NormalizedNodeUtilsTest.java | 8 +-- .../NormalizedNodeXmlTranslationTest.java | 26 +++---- .../tree/ModificationMetadataTreeTest.java | 12 ++-- .../yang/data/impl/schema/tree/TestModel.java | 6 +- .../impl/schema/tree/TreeNodeUtilsTest.java | 24 +++---- .../yang/data/json/schema/TestUtils.java | 24 +++---- .../AbstractContainerNodeModification.java | 28 ++++---- .../AugmentationNodeModification.java | 4 +- .../operations/ChoiceNodeModification.java | 18 ++--- .../operations/ContainerNodeModification.java | 4 +- .../operations/MapEntryNodeModification.java | 4 +- .../data/operations/MapNodeModification.java | 12 ++-- 135 files changed, 677 insertions(+), 677 deletions(-) rename yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/{InstanceIdentifier.java => YangInstanceIdentifier.java} (92%) diff --git a/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/InstanceIdentifierCodecImpl.java b/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/InstanceIdentifierCodecImpl.java index e16baca52d..7c8586ed8f 100644 --- a/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/InstanceIdentifierCodecImpl.java +++ b/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/InstanceIdentifierCodecImpl.java @@ -29,9 +29,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item; import org.opendaylight.yangtools.yang.binding.util.BindingReflections; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.impl.CompositeNodeTOImpl; import org.opendaylight.yangtools.yang.data.impl.SimpleNodeTOImpl; @@ -58,12 +58,12 @@ public class InstanceIdentifierCodecImpl implements InstanceIdentifierCodec { @Override public InstanceIdentifier deserialize( - final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier input) { + final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier input) { Class baType = null; - List biArgs = input.getPath(); + List biArgs = input.getPath(); List scannedPath = new ArrayList<>(biArgs.size()); List baArgs = new ArrayList(biArgs.size()); - for (org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument biArg : biArgs) { + for (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument biArg : biArgs) { scannedPath.add(biArg.getNodeType()); org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument baArg = deserializePathArgument( @@ -88,7 +88,7 @@ public class InstanceIdentifierCodecImpl implements InstanceIdentifierCodec { @Override public InstanceIdentifier deserialize( - final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier input, + final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier input, final InstanceIdentifier bindingIdentifier) { return deserialize(input); } @@ -129,7 +129,7 @@ public class InstanceIdentifierCodecImpl implements InstanceIdentifierCodec { } @Override - public org.opendaylight.yangtools.yang.data.api.InstanceIdentifier serialize(final InstanceIdentifier input) { + public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier serialize(final InstanceIdentifier input) { Class previousAugmentation = null; Iterable pathArgs = input.getPathArguments(); QName previousQName = null; @@ -148,8 +148,8 @@ public class InstanceIdentifierCodecImpl implements InstanceIdentifierCodec { ensureAugmentation(qnamePath,previousQName,baArg.getType()); } } - org.opendaylight.yangtools.yang.data.api.InstanceIdentifier ret = - org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.create(components); + org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier ret = + org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.create(components); LOG.debug("Binding Instance Identifier {} serialized to DOM InstanceIdentifier {}", input, ret); return ret; } @@ -226,7 +226,7 @@ public class InstanceIdentifierCodecImpl implements InstanceIdentifierCodec { } private PathArgument serializePathArgumentAndUpdateMapping(final List parentPath, final InstanceIdentifier.PathArgument baArg, final QName previousQName, final Class previousAugmentation) { - org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument biArg = serializePathArgument(baArg, previousQName); + org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument biArg = serializePathArgument(baArg, previousQName); List qnamePath = new ArrayList<>(parentPath); qnamePath.add(biArg.getNodeType()); ImmutableList currentPath = ImmutableList.copyOf(qnamePath); diff --git a/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/LazyGeneratedCodecRegistry.java b/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/LazyGeneratedCodecRegistry.java index 86f0cdf881..ee5d244f9d 100644 --- a/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/LazyGeneratedCodecRegistry.java +++ b/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/LazyGeneratedCodecRegistry.java @@ -1281,7 +1281,7 @@ class LazyGeneratedCodecRegistry implements CodecRegistry, SchemaContextListener InstanceIdentifier augPath = augTarget.augmentation(augType); try { - org.opendaylight.yangtools.yang.data.api.InstanceIdentifier domPath = getRegistry().getInstanceIdentifierCodec() + org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier domPath = getRegistry().getInstanceIdentifierCodec() .serialize(augPath); if (domPath == null) { LOG.error("Unable to serialize instance identifier for {}", augPath); diff --git a/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/RuntimeGeneratedMappingServiceImpl.java b/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/RuntimeGeneratedMappingServiceImpl.java index a8e631c46c..731b8e5a0a 100644 --- a/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/RuntimeGeneratedMappingServiceImpl.java +++ b/code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/RuntimeGeneratedMappingServiceImpl.java @@ -49,9 +49,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item; import org.opendaylight.yangtools.yang.binding.RpcService; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.impl.CompositeNodeTOImpl; import org.opendaylight.yangtools.yang.data.impl.SimpleNodeTOImpl; @@ -191,17 +191,17 @@ SchemaLock, AutoCloseable, SchemaContextHolder, TypeResolver { } @Override - public Entry toDataDom( + public Entry toDataDom( final Entry, DataObject> entry) { try { - org.opendaylight.yangtools.yang.data.api.InstanceIdentifier key = toDataDom(entry.getKey()); + org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier key = toDataDom(entry.getKey()); CompositeNode data; if (Augmentation.class.isAssignableFrom(entry.getKey().getTargetType())) { data = toCompositeNodeImplAugument(key, entry.getValue()); } else { data = toCompositeNodeImpl(key, entry.getValue()); } - return new SimpleEntry(key, + return new SimpleEntry(key, data); } catch (Exception e) { @@ -217,7 +217,7 @@ SchemaLock, AutoCloseable, SchemaContextHolder, TypeResolver { return codec.serialize(new ValueWithQName(null, object)); } - private CompositeNode toCompositeNodeImpl(final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier identifier, + private CompositeNode toCompositeNodeImpl(final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier identifier, final DataObject object) { PathArgument last = identifier.getLastPathArgument(); Class cls = object.getImplementedInterface(); @@ -227,11 +227,11 @@ SchemaLock, AutoCloseable, SchemaContextHolder, TypeResolver { } private CompositeNode toCompositeNodeImplAugument( - final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier identifier, final DataObject object) { + final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier identifier, final DataObject object) { // val cls = object.implementedInterface; // waitForSchema(cls); - org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument last = identifier.getLastPathArgument(); + org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument last = identifier.getLastPathArgument(); AugmentationCodec codec = registry.getCodecForAugmentation((Class) object.getImplementedInterface()); CompositeNode ret = codec.serialize(new ValueWithQName(last.getNodeType(), object)); if (last instanceof NodeIdentifierWithPredicates) { @@ -261,7 +261,7 @@ SchemaLock, AutoCloseable, SchemaContextHolder, TypeResolver { } @Override - public InstanceIdentifier toDataDom( + public YangInstanceIdentifier toDataDom( final org.opendaylight.yangtools.yang.binding.InstanceIdentifier path) { for (final org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument arg : path.getPathArguments()) { this.waitForSchema(arg.getType()); @@ -301,7 +301,7 @@ SchemaLock, AutoCloseable, SchemaContextHolder, TypeResolver { } @Override - public org.opendaylight.yangtools.yang.binding.InstanceIdentifier fromDataDom(final InstanceIdentifier entry) throws DeserializationException { + public org.opendaylight.yangtools.yang.binding.InstanceIdentifier fromDataDom(final YangInstanceIdentifier entry) throws DeserializationException { try { final InstanceIdentifierCodec c = registry.getInstanceIdentifierCodec(); Preconditions.checkState(c != null, "InstanceIdentifierCodec not present"); diff --git a/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend b/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend index bc4e267b0c..4a78be34a8 100644 --- a/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend +++ b/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend @@ -21,8 +21,6 @@ import java.util.List import java.util.Map import java.util.Set import org.opendaylight.yangtools.yang.common.QName -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode import org.opendaylight.yangtools.yang.model.api.AugmentationTarget import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode @@ -54,6 +52,8 @@ import org.slf4j.Logger import org.slf4j.LoggerFactory import org.sonatype.plexus.build.incremental.BuildContext import org.sonatype.plexus.build.incremental.DefaultBuildContext +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier class GeneratorImpl { @@ -756,15 +756,15 @@ class GeneratorImpl { def CharSequence tree(Module module) ''' «strong(module.name)» - «module.childNodes.treeSet(InstanceIdentifier.builder.toInstance())» + «module.childNodes.treeSet(YangInstanceIdentifier.builder.toInstance())» ''' - private def dispatch CharSequence tree(ChoiceNode node,InstanceIdentifier path) ''' + private def dispatch CharSequence tree(ChoiceNode node,YangInstanceIdentifier path) ''' «node.nodeName» (choice) «casesTree(node.cases,path)» ''' - def casesTree(Set nodes,InstanceIdentifier path) ''' + def casesTree(Set nodes,YangInstanceIdentifier path) '''
    «FOR node : nodes»
  • @@ -775,17 +775,17 @@ class GeneratorImpl {
''' - private def dispatch CharSequence tree(DataSchemaNode node,InstanceIdentifier path) ''' + private def dispatch CharSequence tree(DataSchemaNode node,YangInstanceIdentifier path) ''' «node.nodeName» ''' - private def dispatch CharSequence tree(ListSchemaNode node,InstanceIdentifier path) ''' + private def dispatch CharSequence tree(ListSchemaNode node,YangInstanceIdentifier path) ''' «val newPath = path.append(node)» «localLink(newPath,node.nodeName)» «node.childNodes.treeSet(newPath)» ''' - private def dispatch CharSequence tree(ContainerSchemaNode node,InstanceIdentifier path) ''' + private def dispatch CharSequence tree(ContainerSchemaNode node,YangInstanceIdentifier path) ''' «val newPath = path.append(node)» «localLink(newPath,node.nodeName)» «node.childNodes.treeSet(newPath)» @@ -796,7 +796,7 @@ class GeneratorImpl { «IF !childNodes.nullOrEmpty»

Child nodes

- «childNodes.printChildren(3,InstanceIdentifier.builder().toInstance())» + «childNodes.printChildren(3,YangInstanceIdentifier.builder().toInstance())» «ENDIF» ''' @@ -950,7 +950,7 @@ class GeneratorImpl { ''' } - def CharSequence printChildren(Iterable nodes, int level, InstanceIdentifier path) { + def CharSequence printChildren(Iterable nodes, int level, YangInstanceIdentifier path) { val anyxmlNodes = nodes.filter(AnyXmlSchemaNode) val leafNodes = nodes.filter(LeafSchemaNode) val leafListNodes = nodes.filter(LeafListSchemaNode) @@ -1000,13 +1000,13 @@ class GeneratorImpl { ''' } - def CharSequence xmlExample(Iterable nodes, QName name,InstanceIdentifier path) ''' + def CharSequence xmlExample(Iterable nodes, QName name,YangInstanceIdentifier path) '''
         «xmlExampleTag(name,nodes.xmplExampleTags(path))»
     
''' - def CharSequence xmplExampleTags(Iterable nodes, InstanceIdentifier identifier) ''' + def CharSequence xmplExampleTags(Iterable nodes, YangInstanceIdentifier identifier) ''' «FOR node : nodes» @@ -1015,29 +1015,29 @@ class GeneratorImpl { ''' - private def dispatch CharSequence asXmlExampleTag(LeafSchemaNode node, InstanceIdentifier identifier) ''' + private def dispatch CharSequence asXmlExampleTag(LeafSchemaNode node, YangInstanceIdentifier identifier) ''' «node.QName.xmlExampleTag("...")» ''' - private def dispatch CharSequence asXmlExampleTag(LeafListSchemaNode node, InstanceIdentifier identifier) ''' + private def dispatch CharSequence asXmlExampleTag(LeafListSchemaNode node, YangInstanceIdentifier identifier) ''' <!-- This node could appear multiple times --> «node.QName.xmlExampleTag("...")» ''' - private def dispatch CharSequence asXmlExampleTag(ContainerSchemaNode node, InstanceIdentifier identifier) ''' + private def dispatch CharSequence asXmlExampleTag(ContainerSchemaNode node, YangInstanceIdentifier identifier) ''' <!-- See «localLink(identifier.append(node),"definition")» for child nodes. --> «node.QName.xmlExampleTag("...")» ''' - private def dispatch CharSequence asXmlExampleTag(ListSchemaNode node, InstanceIdentifier identifier) ''' + private def dispatch CharSequence asXmlExampleTag(ListSchemaNode node, YangInstanceIdentifier identifier) ''' <!-- See «localLink(identifier.append(node),"definition")» for child nodes. --> <!-- This node could appear multiple times --> «node.QName.xmlExampleTag("...")» ''' - private def dispatch CharSequence asXmlExampleTag(DataSchemaNode node, InstanceIdentifier identifier) ''' + private def dispatch CharSequence asXmlExampleTag(DataSchemaNode node, YangInstanceIdentifier identifier) ''' ''' @@ -1049,7 +1049,7 @@ class GeneratorImpl { def header(int level,QName name) '''«name.localName»''' - def header(int level,InstanceIdentifier name) ''' + def header(int level,YangInstanceIdentifier name) ''' «FOR cmp : name.path SEPARATOR "/"»«cmp.nodeType.localName»«ENDFOR» @@ -1057,11 +1057,11 @@ class GeneratorImpl { - private def dispatch CharSequence printInfo(DataSchemaNode node, int level, InstanceIdentifier path) ''' + private def dispatch CharSequence printInfo(DataSchemaNode node, int level, YangInstanceIdentifier path) ''' «header(level+1,node.QName)» ''' - private def dispatch CharSequence printInfo(ContainerSchemaNode node, int level, InstanceIdentifier path) ''' + private def dispatch CharSequence printInfo(ContainerSchemaNode node, int level, YangInstanceIdentifier path) ''' «val newPath = path.append(node)» «header(level,newPath)»
@@ -1073,7 +1073,7 @@ class GeneratorImpl { «node.childNodes.printChildren(level,newPath)» ''' - private def dispatch CharSequence printInfo(ListSchemaNode node, int level, InstanceIdentifier path) ''' + private def dispatch CharSequence printInfo(ListSchemaNode node, int level, YangInstanceIdentifier path) ''' «val newPath = path.append(node)» «header(level,newPath)»
@@ -1085,18 +1085,18 @@ class GeneratorImpl { «node.childNodes.printChildren(level,newPath)» ''' - private def dispatch CharSequence printInfo(ChoiceNode node, int level, InstanceIdentifier path) ''' + private def dispatch CharSequence printInfo(ChoiceNode node, int level, YangInstanceIdentifier path) ''' «val Set choiceCases = new HashSet(node.cases)» «choiceCases.printChildren(level,path)» ''' - private def dispatch CharSequence printInfo(ChoiceCaseNode node, int level, InstanceIdentifier path) ''' + private def dispatch CharSequence printInfo(ChoiceCaseNode node, int level, YangInstanceIdentifier path) ''' «node.childNodes.printChildren(level,path)» ''' - def CharSequence printShortInfo(ContainerSchemaNode node, int level, InstanceIdentifier path) { + def CharSequence printShortInfo(ContainerSchemaNode node, int level, YangInstanceIdentifier path) { val newPath = path.append(node); return '''
  • «strong(localLink(newPath,node.QName.localName))» (container) @@ -1107,7 +1107,7 @@ class GeneratorImpl { ''' } - def CharSequence printShortInfo(ListSchemaNode node, int level, InstanceIdentifier path) { + def CharSequence printShortInfo(ListSchemaNode node, int level, YangInstanceIdentifier path) { val newPath = path.append(node); return '''
  • «strong(localLink(newPath,node.QName.localName))» (list) @@ -1118,7 +1118,7 @@ class GeneratorImpl { ''' } - def CharSequence printShortInfo(AnyXmlSchemaNode node, int level, InstanceIdentifier path) { + def CharSequence printShortInfo(AnyXmlSchemaNode node, int level, YangInstanceIdentifier path) { return '''
  • «strong((node.QName.localName))» (anyxml)
      @@ -1129,7 +1129,7 @@ class GeneratorImpl { ''' } - def CharSequence printShortInfo(LeafSchemaNode node, int level, InstanceIdentifier path) { + def CharSequence printShortInfo(LeafSchemaNode node, int level, YangInstanceIdentifier path) { return '''
    • «strong((node.QName.localName))» (leaf)
        @@ -1140,7 +1140,7 @@ class GeneratorImpl { ''' } - def CharSequence printShortInfo(LeafListSchemaNode node, int level, InstanceIdentifier path) { + def CharSequence printShortInfo(LeafListSchemaNode node, int level, YangInstanceIdentifier path) { return '''
      • «strong((node.QName.localName))» (leaf-list)
          @@ -1156,16 +1156,16 @@ class GeneratorImpl { ''' } - def CharSequence localLink(InstanceIdentifier identifier, CharSequence text) ''' + def CharSequence localLink(YangInstanceIdentifier identifier, CharSequence text) ''' «text» ''' - private def dispatch InstanceIdentifier append(InstanceIdentifier identifier, ContainerSchemaNode node) { + private def dispatch YangInstanceIdentifier append(YangInstanceIdentifier identifier, ContainerSchemaNode node) { return identifier.node(node.QName); } - private def dispatch InstanceIdentifier append(InstanceIdentifier identifier, ListSchemaNode node) { + private def dispatch YangInstanceIdentifier append(YangInstanceIdentifier identifier, ListSchemaNode node) { val keyValues = new LinkedHashMap(); if(node.keyDefinition !== null) { for(definition : node.keyDefinition) { @@ -1177,11 +1177,11 @@ class GeneratorImpl { } - def asXmlPath(InstanceIdentifier identifier) { + def asXmlPath(YangInstanceIdentifier identifier) { return ""; } - def asRestconfPath(InstanceIdentifier identifier) { + def asRestconfPath(YangInstanceIdentifier identifier) { val it = new StringBuilder(); append(currentModule.name) append(":") @@ -1192,7 +1192,7 @@ class GeneratorImpl { previous = true; if(arg instanceof NodeIdentifierWithPredicates) { val nodeIdentifier = arg as NodeIdentifierWithPredicates; - for(qname : nodeIdentifier.keyValues.keySet) { + for(qname : nodeIdentifier.getKeyValues.keySet) { append("/{"); append(qname.localName) append("}") @@ -1278,7 +1278,7 @@ class GeneratorImpl { «ENDIF» ''' - private def CharSequence treeSet(Collection childNodes, InstanceIdentifier path) ''' + private def CharSequence treeSet(Collection childNodes, YangInstanceIdentifier path) ''' «IF childNodes !== null && !childNodes.empty»
            «FOR child : childNodes» @@ -1301,7 +1301,7 @@ class GeneratorImpl {
          ''' - private def dispatch CharSequence tree(Void obj, InstanceIdentifier path) ''' + private def dispatch CharSequence tree(Void obj, YangInstanceIdentifier path) ''' ''' diff --git a/integration-test/yang-runtime-tests/src/test/java/org/opendaylight/yangtools/it/yang/runtime/tests/RuntimeCodecAugmentationWithGroupingsAndCasesTest.java b/integration-test/yang-runtime-tests/src/test/java/org/opendaylight/yangtools/it/yang/runtime/tests/RuntimeCodecAugmentationWithGroupingsAndCasesTest.java index 1b01772a62..2e8b046fa4 100644 --- a/integration-test/yang-runtime-tests/src/test/java/org/opendaylight/yangtools/it/yang/runtime/tests/RuntimeCodecAugmentationWithGroupingsAndCasesTest.java +++ b/integration-test/yang-runtime-tests/src/test/java/org/opendaylight/yangtools/it/yang/runtime/tests/RuntimeCodecAugmentationWithGroupingsAndCasesTest.java @@ -70,7 +70,7 @@ public class RuntimeCodecAugmentationWithGroupingsAndCasesTest { .build()) // .build(); - Entry result = mappingService + Entry result = mappingService .toDataDom(new SimpleEntry(GROUPING_AUGMENTATIONS_PATH, caseData)); assertNotNull(result); } diff --git a/restconf/restconf-util/src/main/java/org/opendaylight/yangtools/restconf/utils/RestconfUtils.java b/restconf/restconf-util/src/main/java/org/opendaylight/yangtools/restconf/utils/RestconfUtils.java index 6fc6df7618..4d292b425c 100644 --- a/restconf/restconf-util/src/main/java/org/opendaylight/yangtools/restconf/utils/RestconfUtils.java +++ b/restconf/restconf-util/src/main/java/org/opendaylight/yangtools/restconf/utils/RestconfUtils.java @@ -31,9 +31,9 @@ import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.RpcService; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.impl.ImmutableCompositeNode; import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService; @@ -61,14 +61,14 @@ public class RestconfUtils { public static Entry toRestconfIdentifier( final org.opendaylight.yangtools.yang.binding.InstanceIdentifier bindingIdentifier, final BindingIndependentMappingService mappingService, final SchemaContext schemaContext) { - InstanceIdentifier domIdentifier = mappingService.toDataDom(bindingIdentifier); + YangInstanceIdentifier domIdentifier = mappingService.toDataDom(bindingIdentifier); return toRestconfIdentifier(domIdentifier, schemaContext); } - public static Entry toRestconfIdentifier(final InstanceIdentifier xmlInstanceIdentifier, + public static Entry toRestconfIdentifier(final YangInstanceIdentifier xmlInstanceIdentifier, final SchemaContext schemaContext) { - final Iterable elements = xmlInstanceIdentifier.getPathArguments(); + final Iterable elements = xmlInstanceIdentifier.getPathArguments(); final StringBuilder ret = new StringBuilder(); final QName startQName = elements.iterator().next().getNodeType(); URI namespace = startQName.getNamespace(); @@ -76,7 +76,7 @@ public class RestconfUtils { final Module initialModule = schemaContext.findModuleByNamespaceAndRevision(namespace, revision); DataNodeContainer node = (initialModule); DataSchemaNode schemaNode = null; - for (final InstanceIdentifier.PathArgument element : elements) { + for (final YangInstanceIdentifier.PathArgument element : elements) { final DataSchemaNode potentialNode = node.getDataChildByName(element.getNodeType()); if (!isListOrContainer(potentialNode)) { return null; @@ -88,13 +88,13 @@ public class RestconfUtils { return new SimpleEntry<>(ret.toString(), schemaNode); } - private static CharSequence convertContainerToRestconfIdentifier(final InstanceIdentifier.NodeIdentifier argument, + private static CharSequence convertContainerToRestconfIdentifier(final YangInstanceIdentifier.NodeIdentifier argument, final SchemaContext schemaContext) { return "/" + toRestconfIdentifier(argument.getNodeType(), schemaContext); } private static CharSequence convertListToRestconfIdentifier( - final InstanceIdentifier.NodeIdentifierWithPredicates argument, final ListSchemaNode node, + final YangInstanceIdentifier.NodeIdentifierWithPredicates argument, final ListSchemaNode node, final SchemaContext schemaContext) { QName _nodeType = argument.getNodeType(); final CharSequence nodeIdentifier = toRestconfIdentifier(_nodeType, schemaContext); @@ -143,11 +143,11 @@ public class RestconfUtils { return module + ':' + qname.getLocalName(); } - private static CharSequence convertToRestconfIdentifier(final InstanceIdentifier.PathArgument argument, + private static CharSequence convertToRestconfIdentifier(final YangInstanceIdentifier.PathArgument argument, final DataNodeContainer node, final SchemaContext schemaContext) { - if (argument instanceof InstanceIdentifier.NodeIdentifier) { + if (argument instanceof YangInstanceIdentifier.NodeIdentifier) { return convertContainerToRestconfIdentifier((NodeIdentifier) argument, schemaContext); - } else if (argument instanceof InstanceIdentifier.NodeIdentifierWithPredicates + } else if (argument instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates && node instanceof ListSchemaNode) { return convertListToRestconfIdentifier((NodeIdentifierWithPredicates) argument, (ListSchemaNode) node, schemaContext); diff --git a/restconf/restconf-util/src/test/java/org/opendaylight/yangtools/restconf/utils/Bug1196Test.java b/restconf/restconf-util/src/test/java/org/opendaylight/yangtools/restconf/utils/Bug1196Test.java index ac5d868d39..a1b2488144 100644 --- a/restconf/restconf-util/src/test/java/org/opendaylight/yangtools/restconf/utils/Bug1196Test.java +++ b/restconf/restconf-util/src/test/java/org/opendaylight/yangtools/restconf/utils/Bug1196Test.java @@ -82,7 +82,7 @@ public class Bug1196Test { VsTlv vsTlv = tlvs.getVsTlv(); assertNotNull(vsTlv.getVendorPayload()); - Entry domPcc = mappingService.toDataDom(new SimpleEntry,DataObject>(PATH_TO_CLIENT,pcc)); + Entry domPcc = mappingService.toDataDom(new SimpleEntry,DataObject>(PATH_TO_CLIENT,pcc)); CompositeNode domPccValue = domPcc.getValue(); assertNotNull(domPccValue); CompositeNode domPccTlvs = getFirstReportedLspVsTlvs(domPccValue); @@ -117,7 +117,7 @@ public class Bug1196Test { VsTlv vsTlv = tlvs.getVsTlv(); assertNotNull(vsTlv.getVendorPayload()); - Entry domPcc = mappingService.toDataDom(new SimpleEntry,DataObject>(PATH_TO_CLIENT,pcc)); + Entry domPcc = mappingService.toDataDom(new SimpleEntry,DataObject>(PATH_TO_CLIENT,pcc)); CompositeNode domPccValue = domPcc.getValue(); assertNotNull(domPccValue); CompositeNode domPccTlvs = getFirstReportedLspVsTlvs(domPccValue); diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/InstanceIdentifier.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifier.java similarity index 92% rename from yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/InstanceIdentifier.java rename to yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifier.java index edcf46b867..60432b512f 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/InstanceIdentifier.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifier.java @@ -65,8 +65,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; * * @see http://tools.ietf.org/html/rfc6020#section-9.13 */ -public final class InstanceIdentifier implements Path, Immutable, Serializable { - private static final InstanceIdentifier EMPTY = trustedCreate(Collections.emptyList()); +public final class YangInstanceIdentifier implements Path, Immutable, Serializable { + private static final YangInstanceIdentifier EMPTY = trustedCreate(Collections.emptyList()); private static final long serialVersionUID = 2L; private final Iterable pathArguments; @@ -127,21 +127,21 @@ public final class InstanceIdentifier implements Path, Immut return Iterables.getFirst(getReversePathArguments(), null); } - private InstanceIdentifier(final Iterable path, final int hash) { + private YangInstanceIdentifier(final Iterable path, final int hash) { this.pathArguments = Preconditions.checkNotNull(path, "path must not be null."); this.hash = hash; } - private static final InstanceIdentifier trustedCreate(final Iterable path) { + private static final YangInstanceIdentifier trustedCreate(final Iterable path) { final HashCodeBuilder hash = new HashCodeBuilder<>(); for (PathArgument a : path) { hash.addArgument(a); } - return new InstanceIdentifier(path, hash.toInstance()); + return new YangInstanceIdentifier(path, hash.toInstance()); } - public static final InstanceIdentifier create(final Iterable path) { + public static final YangInstanceIdentifier create(final Iterable path) { if (Iterables.isEmpty(path)) { return EMPTY; } @@ -149,7 +149,7 @@ public final class InstanceIdentifier implements Path, Immut return trustedCreate(ImmutableList.copyOf(path)); } - public static final InstanceIdentifier create(final PathArgument... path) { + public static final YangInstanceIdentifier create(final PathArgument... path) { // We are forcing a copy, since we cannot trust the user return create(Arrays.asList(path)); } @@ -177,7 +177,7 @@ public final class InstanceIdentifier implements Path, Immut if (getClass() != obj.getClass()) { return false; } - InstanceIdentifier other = (InstanceIdentifier) obj; + YangInstanceIdentifier other = (YangInstanceIdentifier) obj; if (this.hashCode() != obj.hashCode()) { return false; } @@ -190,7 +190,7 @@ public final class InstanceIdentifier implements Path, Immut * @param name QName of {@link NodeIdentifier} * @return Instance Identifier with additional path argument added to the end. */ - public InstanceIdentifier node(final QName name) { + public YangInstanceIdentifier node(final QName name) { return node(new NodeIdentifier(name)); } @@ -201,8 +201,8 @@ public final class InstanceIdentifier implements Path, Immut * @param arg Path argument which should be added to the end * @return Instance Identifier with additional path argument added to the end. */ - public InstanceIdentifier node(final PathArgument arg) { - return new InstanceIdentifier(Iterables.concat(pathArguments, Collections.singleton(arg)), HashCodeBuilder.nextHashCode(hash, arg)); + public YangInstanceIdentifier node(final PathArgument arg) { + return new YangInstanceIdentifier(Iterables.concat(pathArguments, Collections.singleton(arg)), HashCodeBuilder.nextHashCode(hash, arg)); } /** @@ -214,7 +214,7 @@ public final class InstanceIdentifier implements Path, Immut * @return This object's relative path from parent, or Optional.absent() if * the specified parent is not in fact an ancestor of this object. */ - public Optional relativeTo(final InstanceIdentifier ancestor) { + public Optional relativeTo(final YangInstanceIdentifier ancestor) { final Iterator lit = pathArguments.iterator(); final Iterator oit = ancestor.pathArguments.iterator(); int common = 0; @@ -268,7 +268,7 @@ public final class InstanceIdentifier implements Path, Immut * @param name QName of first node identifier * @return Instance Identifier with only one path argument of type {@link NodeIdentifier} */ - public static InstanceIdentifier of(final QName name) { + public static YangInstanceIdentifier of(final QName name) { return create(new NodeIdentifier(name)); } @@ -289,7 +289,7 @@ public final class InstanceIdentifier implements Path, Immut * @param origin Instace Identifier from which path arguments are copied. * @return new builder for InstanceIdentifier with path arguments copied from original instance identifier. */ - static public InstanceIdentifierBuilder builder(final InstanceIdentifier origin) { + static public InstanceIdentifierBuilder builder(final YangInstanceIdentifier origin) { return new BuilderImpl(origin.getPathArguments(), origin.hashCode()); } @@ -387,7 +387,7 @@ public final class InstanceIdentifier implements Path, Immut * @ * */ - public interface InstanceIdentifierBuilder extends Builder { + public interface InstanceIdentifierBuilder extends Builder { /** * Adds {@link NodeIdentifier} with supplied QName to path arguments of resulting instance identifier. * @@ -417,11 +417,11 @@ public final class InstanceIdentifier implements Path, Immut /** * - * Builds an {@link InstanceIdentifier} with path arguments from this builder + * Builds an {@link YangInstanceIdentifier} with path arguments from this builder * - * @return {@link InstanceIdentifier} + * @return {@link YangInstanceIdentifier} */ - InstanceIdentifier build(); + YangInstanceIdentifier build(); } /** @@ -465,7 +465,7 @@ public final class InstanceIdentifier implements Path, Immut result = prime * result; for (Entry entry : keyValues.entrySet()) { - result += Objects.hashCode(entry.getKey()) + InstanceIdentifier.hashCode(entry.getValue()); + result += Objects.hashCode(entry.getKey()) + YangInstanceIdentifier.hashCode(entry.getValue()); } return result; } @@ -520,7 +520,7 @@ public final class InstanceIdentifier implements Path, Immut public int hashCode() { final int prime = 31; int result = super.hashCode(); - result = prime * result + ((value == null) ? 0 : InstanceIdentifier.hashCode(value)); + result = prime * result + ((value == null) ? 0 : YangInstanceIdentifier.hashCode(value)); return result; } @@ -688,18 +688,18 @@ public final class InstanceIdentifier implements Path, Immut @Override @Deprecated - public InstanceIdentifier toInstance() { + public YangInstanceIdentifier toInstance() { return build(); } @Override - public InstanceIdentifier build() { - return new InstanceIdentifier(ImmutableList.copyOf(path), hash.toInstance()); + public YangInstanceIdentifier build() { + return new YangInstanceIdentifier(ImmutableList.copyOf(path), hash.toInstance()); } } @Override - public boolean contains(final InstanceIdentifier other) { + public boolean contains(final YangInstanceIdentifier other) { Preconditions.checkArgument(other != null, "other should not be null"); final Iterator lit = pathArguments.iterator(); diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/codec/InstanceIdentifierCodec.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/codec/InstanceIdentifierCodec.java index 9a98405705..097908f645 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/codec/InstanceIdentifierCodec.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/codec/InstanceIdentifierCodec.java @@ -8,17 +8,17 @@ package org.opendaylight.yangtools.yang.data.api.codec; import org.opendaylight.yangtools.concepts.Codec; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; /** * * Codec which serializes / deserializes InstanceIdentifier * * @param Target type */ -public interface InstanceIdentifierCodec extends Codec { +public interface InstanceIdentifierCodec extends Codec { @Override - T serialize(InstanceIdentifier data); + T serialize(YangInstanceIdentifier data); @Override - InstanceIdentifier deserialize(T data); + YangInstanceIdentifier deserialize(T data); } diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AnyXmlNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AnyXmlNode.java index 6d89b60467..3ac5803a25 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AnyXmlNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AnyXmlNode.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.api.schema; import org.opendaylight.yangtools.yang.data.api.AttributesContainer; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.Node; /** diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AugmentationNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AugmentationNode.java index fa7a03fa56..71fa5c705a 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AugmentationNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AugmentationNode.java @@ -7,9 +7,9 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.model.api.AugmentationSchema; @@ -27,7 +27,7 @@ import org.opendaylight.yangtools.yang.model.api.AugmentationSchema; public interface AugmentationNode extends // MixinNode, // DataContainerNode, - DataContainerChild>> { + DataContainerChild>> { /** * Gets identifier of augmentation node diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/ChoiceNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/ChoiceNode.java index 6ce46cb044..dd18d47f9d 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/ChoiceNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/ChoiceNode.java @@ -7,8 +7,8 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; /** * diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/ContainerNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/ContainerNode.java index b4872df34c..7872466b35 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/ContainerNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/ContainerNode.java @@ -8,8 +8,8 @@ package org.opendaylight.yangtools.yang.data.api.schema; import org.opendaylight.yangtools.yang.data.api.AttributesContainer; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; /** * Data subtree with cardinality 0..1 in the context of parent node diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerChild.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerChild.java index c1e3844540..b08cfa06f9 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerChild.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerChild.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; /** * diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerNode.java index 0c3fc224bd..a9e90d566e 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerNode.java @@ -6,7 +6,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; /** * diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafNode.java index 89d9f49342..38aee4f11b 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafNode.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.api.schema; import org.opendaylight.yangtools.yang.data.api.AttributesContainer; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; /** * diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafSetEntryNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafSetEntryNode.java index 103f88ff53..505acf7b44 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafSetEntryNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafSetEntryNode.java @@ -7,7 +7,7 @@ package org.opendaylight.yangtools.yang.data.api.schema; import org.opendaylight.yangtools.yang.data.api.AttributesContainer; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue; /** * diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafSetNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafSetNode.java index 70829e1eb6..b58fd5bd2c 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafSetNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/LeafSetNode.java @@ -7,8 +7,8 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue; /** * diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapEntryNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapEntryNode.java index 94ea04937c..e34e5ec495 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapEntryNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapEntryNode.java @@ -7,7 +7,7 @@ package org.opendaylight.yangtools.yang.data.api.schema; import org.opendaylight.yangtools.yang.data.api.AttributesContainer; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; /** * @@ -21,9 +21,9 @@ public interface MapEntryNode extends AttributesContainer, DataContainerNodekey ( - * {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.ListSchemaNode#getKeyDefinition()} + * {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.ListSchemaNode#getKeyDefinition()} * ) statement in YANG schema for associated list item and child {@link LeafNode}s - * values with {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier} + * values with {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier} * as defined in the schema. * * @return identifier of this node in the context of parent node diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapNode.java index 1b916c21ff..d906050dea 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/MapNode.java @@ -7,8 +7,8 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; /** * Containment node, which contains {@link MapEntryNode} of the same type, which may diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNode.java index 36d4bdd228..c1aa3bbf50 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNode.java @@ -9,12 +9,12 @@ package org.opendaylight.yangtools.yang.data.api.schema; import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; /** * * Node which is normalized according to the YANG schema - * is identifiable by {@link InstanceIdentifier}. + * is identifiable by {@link YangInstanceIdentifier}. * * See subinterfaces of this interface for concretization * of node. @@ -22,7 +22,7 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; * @param Local identifier of node * @param Value of node */ -public interface NormalizedNode extends Identifiable { +public interface NormalizedNode extends Identifiable { /** * QName of the node as defined in YANG schema. * diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNodeContainer.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNodeContainer.java index b3d2bdb1af..b416f78fa1 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNodeContainer.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNodeContainer.java @@ -6,7 +6,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import com.google.common.base.Optional; diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/OrderedNodeContainer.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/OrderedNodeContainer.java index 72e2901e75..5d37b7dffa 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/OrderedNodeContainer.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/OrderedNodeContainer.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; /** * diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/UnkeyedListEntryNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/UnkeyedListEntryNode.java index c1dca0f700..cca1a7c13b 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/UnkeyedListEntryNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/UnkeyedListEntryNode.java @@ -6,7 +6,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; /** * List entry node, which does not have value, but child nodes. diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/UnkeyedListNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/UnkeyedListNode.java index ff2ca1f7d9..855705d36f 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/UnkeyedListNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/UnkeyedListNode.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; /** diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/package-info.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/package-info.java index bed148306a..fd6d8e214a 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/package-info.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/package-info.java @@ -70,22 +70,22 @@ *

          Tree / subtree structure

          Grammar representation

          * *
          - *  {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument}*
          - *  {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier}| {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates}| {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue} | {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier}
          + *  {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument}*
          + *  {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier}| {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates}| {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue} | {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier}
            *
            *  TreeRoot = {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
            *  {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode} = ( {@link org.opendaylight.yangtools.yang.data.api.schema.LeafNode} | {@link org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode} | {@link org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode} | {@link org.opendaylight.yangtools.yang.data.api.schema.MapNode} | {@link org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode})*
          - *  ContainerDataNode = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
          + *  ContainerDataNode = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
            *
          - *  {@link org.opendaylight.yangtools.yang.data.api.schema.LeafNode} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier} SimpleValue
          - *  {@link org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
          - *  {@link org.opendaylight.yangtools.yang.data.api.schema.MapNode} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode}
          - *  {@link org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates} {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
          + *  {@link org.opendaylight.yangtools.yang.data.api.schema.LeafNode} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier} SimpleValue
          + *  {@link org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
          + *  {@link org.opendaylight.yangtools.yang.data.api.schema.MapNode} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode}
          + *  {@link org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates} {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
            *
            *  // Special nodes
          - *  {@link org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode}*
          - *  {@link org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
          - *  {@link org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode} = {@link org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue} SimpleValue
          + *  {@link org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode}*
          + *  {@link org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier} {@link org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode}
          + *  {@link org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode} = {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue} SimpleValue
            * 
          * * The resulting tree organization is following: diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/ConflictingModificationAppliedException.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/ConflictingModificationAppliedException.java index ee1ee8c8fa..59610c28a3 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/ConflictingModificationAppliedException.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/ConflictingModificationAppliedException.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; /** * Exception thrown when a proposed change fails validation before being @@ -22,11 +22,11 @@ public class ConflictingModificationAppliedException extends DataValidationFaile */ private static final long serialVersionUID = 1L; - public ConflictingModificationAppliedException(final InstanceIdentifier path, final String message, final Throwable cause) { + public ConflictingModificationAppliedException(final YangInstanceIdentifier path, final String message, final Throwable cause) { super(path, message, cause); } - public ConflictingModificationAppliedException(final InstanceIdentifier path, final String message) { + public ConflictingModificationAppliedException(final YangInstanceIdentifier path, final String message) { super(path, message); } diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidate.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidate.java index bc9fb3398f..7f65bbc251 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidate.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidate.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; /** * An encapsulation of a validated data tree modification. This candidate @@ -31,5 +31,5 @@ public interface DataTreeCandidate { * * @return Relative path of the root node */ - InstanceIdentifier getRootPath(); + YangInstanceIdentifier getRootPath(); } diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidateNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidateNode.java index 67c7533397..76f3f563cd 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidateNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidateNode.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import com.google.common.base.Optional; diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeModification.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeModification.java index 8b0dc2e27c..2d11f106b0 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeModification.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeModification.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; /** @@ -21,7 +21,7 @@ public interface DataTreeModification extends DataTreeSnapshot { * * @param path Node path */ - void delete(InstanceIdentifier path); + void delete(YangInstanceIdentifier path); /** * Merge the specified data with the currently-present data @@ -30,7 +30,7 @@ public interface DataTreeModification extends DataTreeSnapshot { * @param path Node path * @param data Data to be merged */ - void merge(InstanceIdentifier path, NormalizedNode data); + void merge(YangInstanceIdentifier path, NormalizedNode data); /** * Replace the data at specified path with supplied data. @@ -38,7 +38,7 @@ public interface DataTreeModification extends DataTreeSnapshot { * @param path Node path * @param data New node data */ - void write(InstanceIdentifier path, NormalizedNode data); + void write(YangInstanceIdentifier path, NormalizedNode data); /** * Finish creation of a modification, making it ready for application diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeSnapshot.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeSnapshot.java index 4eb268a188..0d280e8f2c 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeSnapshot.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeSnapshot.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import com.google.common.base.Optional; @@ -24,7 +24,7 @@ public interface DataTreeSnapshot { * @param path Path of the node * @return Optional result encapsulating the presence and value of the node */ - Optional> readNode(InstanceIdentifier path); + Optional> readNode(YangInstanceIdentifier path); /** * Create a new data tree modification based on this snapshot, using the diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataValidationFailedException.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataValidationFailedException.java index f444164177..6f12869009 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataValidationFailedException.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataValidationFailedException.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import com.google.common.base.Preconditions; @@ -19,7 +19,7 @@ import com.google.common.base.Preconditions; */ public class DataValidationFailedException extends Exception { private static final long serialVersionUID = 1L; - private final InstanceIdentifier path; + private final YangInstanceIdentifier path; /** * Create a new instance. @@ -27,7 +27,7 @@ public class DataValidationFailedException extends Exception { * @param path Object path which caused this exception * @param message Specific message describing the failure */ - public DataValidationFailedException(final InstanceIdentifier path, final String message) { + public DataValidationFailedException(final YangInstanceIdentifier path, final String message) { this(path, message, null); } /** @@ -37,7 +37,7 @@ public class DataValidationFailedException extends Exception { * @param message Specific message describing the failure * @param cause Exception which triggered this failure, may be null */ - public DataValidationFailedException(final InstanceIdentifier path, final String message, final Throwable cause) { + public DataValidationFailedException(final YangInstanceIdentifier path, final String message, final Throwable cause) { super(message, cause); this.path = Preconditions.checkNotNull(path); } @@ -47,7 +47,7 @@ public class DataValidationFailedException extends Exception { * * @return Path of the offending object */ - public InstanceIdentifier getPath() { + public YangInstanceIdentifier getPath() { return path; } } diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/IncorrectDataStructureException.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/IncorrectDataStructureException.java index c816a944bb..07f435adcc 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/IncorrectDataStructureException.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/IncorrectDataStructureException.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; /** * Exception thrown when a proposed change fails validation before being @@ -22,11 +22,11 @@ public class IncorrectDataStructureException extends DataValidationFailedExcepti */ private static final long serialVersionUID = 1L; - public IncorrectDataStructureException(final InstanceIdentifier path, final String message, final Throwable cause) { + public IncorrectDataStructureException(final YangInstanceIdentifier path, final String message, final Throwable cause) { super(path, message, cause); } - public IncorrectDataStructureException(final InstanceIdentifier path, final String message) { + public IncorrectDataStructureException(final YangInstanceIdentifier path, final String message) { super(path, message); } diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/ModifiedNodeDoesNotExistException.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/ModifiedNodeDoesNotExistException.java index 068fe09a91..d769b9906c 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/ModifiedNodeDoesNotExistException.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/ModifiedNodeDoesNotExistException.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; /** * Exception thrown when a proposed change fails validation before being @@ -27,11 +27,11 @@ public class ModifiedNodeDoesNotExistException extends DataValidationFailedExcep */ private static final long serialVersionUID = 1L; - public ModifiedNodeDoesNotExistException(final InstanceIdentifier path, final String message, final Throwable cause) { + public ModifiedNodeDoesNotExistException(final YangInstanceIdentifier path, final String message, final Throwable cause) { super(path, message, cause); } - public ModifiedNodeDoesNotExistException(final InstanceIdentifier path, final String message) { + public ModifiedNodeDoesNotExistException(final YangInstanceIdentifier path, final String message) { super(path, message); } diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/StoreTreeNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/StoreTreeNode.java index 9d283e2e5e..e54683e95f 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/StoreTreeNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/StoreTreeNode.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import com.google.common.base.Optional; diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/AbstractTreeNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/AbstractTreeNode.java index 4304d4d317..33629fff7c 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/AbstractTreeNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/AbstractTreeNode.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree.spi; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import com.google.common.base.Preconditions; diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/ContainerNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/ContainerNode.java index 03b416b492..6b9e36eb7a 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/ContainerNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/ContainerNode.java @@ -11,7 +11,7 @@ import java.util.HashMap; import java.util.Map; import org.opendaylight.yangtools.util.MapAdaptor; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +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.NormalizedNodeContainer; import org.opendaylight.yangtools.yang.data.api.schema.OrderedNodeContainer; diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/MutableTreeNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/MutableTreeNode.java index c9f7f411a1..7611437781 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/MutableTreeNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/MutableTreeNode.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.api.schema.tree.spi; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +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.StoreTreeNode; diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/TreeNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/TreeNode.java index d97f143d18..e1daad6067 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/TreeNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/TreeNode.java @@ -9,7 +9,7 @@ package org.opendaylight.yangtools.yang.data.api.schema.tree.spi; import org.opendaylight.yangtools.concepts.Identifiable; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +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.StoreTreeNode; diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/ValueNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/ValueNode.java index c0a586b24a..cf94651ba0 100644 --- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/ValueNode.java +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/spi/ValueNode.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.api.schema.tree.spi; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/yang/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/InstanceIdentifierTest.java b/yang/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/InstanceIdentifierTest.java index 7f64380176..3cc626389c 100644 --- a/yang/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/InstanceIdentifierTest.java +++ b/yang/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/InstanceIdentifierTest.java @@ -23,11 +23,11 @@ import java.util.Map.Entry; import org.junit.Test; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; /** * Unit tests for InstanceIdentifier. @@ -47,10 +47,10 @@ public class InstanceIdentifierTest { @Test public void testHashCodeEquals() { - InstanceIdentifier id1 = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); - InstanceIdentifier id2 = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); - InstanceIdentifier id3 = InstanceIdentifier.create(new NodeIdentifier(nodeName2), new NodeIdentifier(nodeName1)); - InstanceIdentifier id4 = InstanceIdentifier.create(new NodeIdentifier(nodeName1)); + YangInstanceIdentifier id1 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); + YangInstanceIdentifier id2 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); + YangInstanceIdentifier id3 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName2), new NodeIdentifier(nodeName1)); + YangInstanceIdentifier id4 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1)); assertEquals( "hashCode", id1.hashCode(), id2.hashCode() ); assertEquals( "equals", true, id1.equals( id2 ) ); @@ -63,9 +63,9 @@ public class InstanceIdentifierTest { @Test public void testNode() { - InstanceIdentifier id = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); + YangInstanceIdentifier id = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); - InstanceIdentifier newID = id.node( nodeName3 ); + YangInstanceIdentifier newID = id.node( nodeName3 ); assertNotNull( "InstanceIdentifier is null", newID ); assertEquals( "Path size", 3, Iterables.size(newID.getPathArguments()) ); @@ -89,13 +89,13 @@ public class InstanceIdentifierTest { @Test public void testRelativeTo() { - InstanceIdentifier id1 = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2), + YangInstanceIdentifier id1 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2), new NodeIdentifier(nodeName3), new NodeIdentifier(nodeName4)); - InstanceIdentifier id2 = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); - InstanceIdentifier id3 = InstanceIdentifier.create( + YangInstanceIdentifier id2 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); + YangInstanceIdentifier id3 = YangInstanceIdentifier.create( Lists.newArrayList(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2))); - Optional relative = id1.relativeTo( id2 ); + Optional relative = id1.relativeTo( id2 ); assertEquals( "isPresent", true, relative.isPresent() ); @@ -115,11 +115,11 @@ public class InstanceIdentifierTest { @Test public void testContains() { - InstanceIdentifier id1 = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2), + YangInstanceIdentifier id1 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2), new NodeIdentifier(nodeName3), new NodeIdentifier(nodeName4)); - InstanceIdentifier id2 = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); - InstanceIdentifier id3 = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); - InstanceIdentifier id4 = InstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName3)); + YangInstanceIdentifier id2 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); + YangInstanceIdentifier id3 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName2)); + YangInstanceIdentifier id4 = YangInstanceIdentifier.create(new NodeIdentifier(nodeName1), new NodeIdentifier(nodeName3)); assertEquals( "contains", true, id2.contains( id1 ) ); assertEquals( "contains", true, id2.contains( id3 ) ); @@ -130,7 +130,7 @@ public class InstanceIdentifierTest { @Test public void testOf() { - InstanceIdentifier newID = InstanceIdentifier.of( nodeName1 ); + YangInstanceIdentifier newID = YangInstanceIdentifier.of( nodeName1 ); assertNotNull( "InstanceIdentifier is null", newID ); assertEquals( "Path size", 1, Iterables.size(newID.getPathArguments()) ); @@ -142,7 +142,7 @@ public class InstanceIdentifierTest { @Test public void testBuilder() { - InstanceIdentifier newID = InstanceIdentifier.builder() + YangInstanceIdentifier newID = YangInstanceIdentifier.builder() .node( nodeName1 ) .nodeWithKey( nodeName2, Collections.singletonMap( key1, "foo" ) ) .nodeWithKey( nodeName3, key2, "bar" ).build(); @@ -155,7 +155,7 @@ public class InstanceIdentifierTest { verifyNodeIdentifierWithPredicates( "PathArg 2", it.next(), nodeName2, key1, "foo" ); verifyNodeIdentifierWithPredicates( "PathArg 3", it.next(), nodeName3, key2, "bar" ); - newID = InstanceIdentifier.builder( newID ).node( nodeName4 ).build(); + newID = YangInstanceIdentifier.builder( newID ).node( nodeName4 ).build(); assertNotNull( "InstanceIdentifier is null", newID ); assertEquals( "Path size", 4, Iterables.size(newID.getPathArguments()) ); @@ -166,7 +166,7 @@ public class InstanceIdentifierTest { assertEquals( "PathArg 3 node type", nodeName3, it.next().getNodeType() ); assertEquals( "PathArg 4 node type", nodeName4, it.next().getNodeType() ); - newID = InstanceIdentifier.builder( nodeName1 ).build(); + newID = YangInstanceIdentifier.builder( nodeName1 ).build(); assertNotNull( "InstanceIdentifier is null", newID ); assertEquals( "Path size", 1, Iterables.size(newID.getPathArguments()) ); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/BindingIndependentMappingService.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/BindingIndependentMappingService.java index 7d6dd678b1..e4a09a03b5 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/BindingIndependentMappingService.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/BindingIndependentMappingService.java @@ -48,7 +48,7 @@ public interface BindingIndependentMappingService { * class object * @return data schema node identifier */ - Entry toDataDom( + Entry toDataDom( Entry, DataObject> entry); /** @@ -58,7 +58,7 @@ public interface BindingIndependentMappingService { * class object identifier * @return data schema node identifier */ - org.opendaylight.yangtools.yang.data.api.InstanceIdentifier toDataDom(InstanceIdentifier path); + org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier toDataDom(InstanceIdentifier path); /** * Create DataObject instance from CompositeNode data based on given path. @@ -79,7 +79,7 @@ public interface BindingIndependentMappingService { * data schema node identifier * @return class object identifier */ - InstanceIdentifier fromDataDom(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier entry) + InstanceIdentifier fromDataDom(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier entry) throws DeserializationException; /** diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/InstanceIdentifierCodec.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/InstanceIdentifierCodec.java index cbb977457e..5f85b4f0a2 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/InstanceIdentifierCodec.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/InstanceIdentifierCodec.java @@ -10,11 +10,11 @@ package org.opendaylight.yangtools.yang.data.impl.codec; import org.opendaylight.yangtools.yang.binding.BindingCodec; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -public interface InstanceIdentifierCodec extends BindingCodec> { +public interface InstanceIdentifierCodec extends BindingCodec> { @Override - org.opendaylight.yangtools.yang.data.api.InstanceIdentifier serialize(InstanceIdentifier input); + org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier serialize(InstanceIdentifier input); @Override - InstanceIdentifier deserialize(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier input); + InstanceIdentifier deserialize(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier input); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/InstanceIdentifierForXmlCodec.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/InstanceIdentifierForXmlCodec.java index cb96677928..0ad2fc2134 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/InstanceIdentifierForXmlCodec.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/InstanceIdentifierForXmlCodec.java @@ -22,8 +22,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.w3c.dom.Element; @@ -37,7 +37,7 @@ public final class InstanceIdentifierForXmlCodec { throw new UnsupportedOperationException("Utility class"); } - public static InstanceIdentifier deserialize(final Element element, final SchemaContext schemaContext) { + public static YangInstanceIdentifier deserialize(final Element element, final SchemaContext schemaContext) { Preconditions.checkNotNull(element, "Value of element for deserialization can't be null"); Preconditions.checkNotNull(schemaContext, "Schema context for deserialization of instance identifier type can't be null"); @@ -59,10 +59,10 @@ public final class InstanceIdentifierForXmlCodec { result.add(pathArgument); } } - return InstanceIdentifier.create(result); + return YangInstanceIdentifier.create(result); } - public static Element serialize(final InstanceIdentifier id, final Element element) { + public static Element serialize(final YangInstanceIdentifier id, final Element element) { Preconditions.checkNotNull(id, "Variable should contain instance of instance identifier and can't be null"); Preconditions.checkNotNull(element, "DOM element can't be null"); @@ -110,9 +110,9 @@ public final class InstanceIdentifierForXmlCodec { } if (predicates.isEmpty()) { - return new InstanceIdentifier.NodeIdentifier(mainQName); + return new YangInstanceIdentifier.NodeIdentifier(mainQName); } else { - return new InstanceIdentifier.NodeIdentifierWithPredicates(mainQName, predicates); + return new YangInstanceIdentifier.NodeIdentifierWithPredicates(mainQName, predicates); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlStreamUtils.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlStreamUtils.java index 9471a1be29..8d42a8c46a 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlStreamUtils.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlStreamUtils.java @@ -16,7 +16,7 @@ import javax.xml.stream.XMLStreamWriter; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.AttributesContainer; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.api.SimpleNode; import org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec; @@ -86,7 +86,7 @@ public class XmlStreamUtils { * @param id InstanceIdentifier * @throws XMLStreamException */ - public static void write(final @Nonnull XMLStreamWriter writer, final @Nonnull InstanceIdentifier id) throws XMLStreamException { + public static void write(final @Nonnull XMLStreamWriter writer, final @Nonnull YangInstanceIdentifier id) throws XMLStreamException { Preconditions.checkNotNull(writer, "Writer may not be null"); Preconditions.checkNotNull(id, "Variable should contain instance of instance identifier and can't be null"); @@ -255,8 +255,8 @@ public class XmlStreamUtils { } private static void write(final @Nonnull XMLStreamWriter writer, final @Nonnull InstanceIdentifierTypeDefinition type, final @Nonnull Object value) throws XMLStreamException { - if (value instanceof InstanceIdentifier) { - write(writer, (InstanceIdentifier)value); + if (value instanceof YangInstanceIdentifier) { + write(writer, (YangInstanceIdentifier)value); } else { LOG.debug("Value of {}:{} is not an InstanceIdentifier but {}", type.getQName().getNamespace(), type.getQName().getLocalName(), value.getClass()); writer.writeCharacters(String.valueOf(value)); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlUtils.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlUtils.java index fbdc8399ef..e097771e84 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlUtils.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlUtils.java @@ -12,10 +12,10 @@ import java.util.Map; import javax.annotation.Nonnull; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec; import org.opendaylight.yangtools.yang.model.api.TypeDefinition; @@ -42,7 +42,7 @@ public final class XmlUtils { return superType; } - static String encodeIdentifier(final RandomPrefix prefixes, final InstanceIdentifier id) { + static String encodeIdentifier(final RandomPrefix prefixes, final YangInstanceIdentifier id) { StringBuilder textContent = new StringBuilder(); for (PathArgument pathArgument : id.getPathArguments()) { textContent.append('/'); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/Builders.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/Builders.java index 45819ccfe5..1491a14788 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/Builders.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/Builders.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; @@ -61,29 +61,29 @@ public final class Builders { throw new UnsupportedOperationException("Utilities class should not be instantiated"); } - public static NormalizedNodeAttrBuilder> leafBuilder() { + public static NormalizedNodeAttrBuilder> leafBuilder() { return ImmutableLeafNodeBuilder.create(); } - public static NormalizedNodeAttrBuilder> leafBuilder( + public static NormalizedNodeAttrBuilder> leafBuilder( final LeafSchemaNode schema) { return ImmutableLeafNodeSchemaAwareBuilder.create(schema); } - public static NormalizedNodeAttrBuilder> leafSetEntryBuilder() { + public static NormalizedNodeAttrBuilder> leafSetEntryBuilder() { return ImmutableLeafSetEntryNodeBuilder.create(); } - public static NormalizedNodeAttrBuilder> leafSetEntryBuilder( + public static NormalizedNodeAttrBuilder> leafSetEntryBuilder( final LeafListSchemaNode schema) { return ImmutableLeafSetEntryNodeSchemaAwareBuilder.create(schema); } - public static NormalizedNodeAttrBuilder, AnyXmlNode> anyXmlBuilder() { + public static NormalizedNodeAttrBuilder, AnyXmlNode> anyXmlBuilder() { return ImmutableAnyXmlNodeBuilder.create(); } - public static NormalizedNodeAttrBuilder, AnyXmlNode> anyXmlBuilder( + public static NormalizedNodeAttrBuilder, AnyXmlNode> anyXmlBuilder( final AnyXmlSchemaNode schema) { return ImmutableAnyXmlNodeSchemaAwareBuilder.create(schema); } @@ -108,29 +108,29 @@ public final class Builders { return ImmutableLeafSetNodeSchemaAwareBuilder.create(schema, node); } - public static DataContainerNodeAttrBuilder containerBuilder() { + public static DataContainerNodeAttrBuilder containerBuilder() { return ImmutableContainerNodeBuilder.create(); } - public static DataContainerNodeAttrBuilder containerBuilder(final ContainerNode node) { + public static DataContainerNodeAttrBuilder containerBuilder(final ContainerNode node) { return ImmutableContainerNodeBuilder.create(node); } - public static DataContainerNodeAttrBuilder containerBuilder( + public static DataContainerNodeAttrBuilder containerBuilder( final ContainerSchemaNode schema) { return ImmutableContainerNodeSchemaAwareBuilder.create(schema); } - public static DataContainerNodeAttrBuilder containerBuilder( + public static DataContainerNodeAttrBuilder containerBuilder( final ContainerSchemaNode schema, final ContainerNode node) { return ImmutableContainerNodeSchemaAwareBuilder.create(schema, node); } - public static DataContainerNodeAttrBuilder mapEntryBuilder() { + public static DataContainerNodeAttrBuilder mapEntryBuilder() { return ImmutableMapEntryNodeBuilder.create(); } - public static DataContainerNodeAttrBuilder mapEntryBuilder( + public static DataContainerNodeAttrBuilder mapEntryBuilder( final ListSchemaNode schema) { return ImmutableMapEntryNodeSchemaAwareBuilder.create(schema); } @@ -159,23 +159,23 @@ public final class Builders { return ImmutableMapNodeSchemaAwareBuilder.create(schema, node); } - public static DataContainerNodeBuilder augmentationBuilder() { + public static DataContainerNodeBuilder augmentationBuilder() { return ImmutableAugmentationNodeBuilder.create(); } - public static DataContainerNodeBuilder augmentationBuilder(final AugmentationSchema schema) { + public static DataContainerNodeBuilder augmentationBuilder(final AugmentationSchema schema) { return ImmutableAugmentationNodeSchemaAwareBuilder.create(schema); } - public static DataContainerNodeBuilder choiceBuilder() { + public static DataContainerNodeBuilder choiceBuilder() { return ImmutableChoiceNodeBuilder.create(); } - public static DataContainerNodeBuilder choiceBuilder(final org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) { + public static DataContainerNodeBuilder choiceBuilder(final org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) { return ImmutableChoiceNodeSchemaAwareBuilder.create(schema); } - public static DataContainerNodeAttrBuilder unkeyedListEntryBuilder() { + public static DataContainerNodeAttrBuilder unkeyedListEntryBuilder() { return ImmutableUnkeyedListEntryNodeBuilder.create(); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/ImmutableNodes.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/ImmutableNodes.java index 21e2792dde..5d3fadb02a 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/ImmutableNodes.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/ImmutableNodes.java @@ -8,8 +8,8 @@ package org.opendaylight.yangtools.yang.data.impl.schema; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/NormalizedNodeUtils.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/NormalizedNodeUtils.java index 1197f56427..997db8eab7 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/NormalizedNodeUtils.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/NormalizedNodeUtils.java @@ -13,10 +13,10 @@ import com.google.common.base.Optional; import java.util.Iterator; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; @@ -29,8 +29,8 @@ public final class NormalizedNodeUtils { throw new UnsupportedOperationException("Utilities class should not be instantiated"); } - public static Optional> findNode(final InstanceIdentifier rootPath, final NormalizedNode rootNode, final InstanceIdentifier childPath) { - final Optional relativePath = childPath.relativeTo(rootPath); + public static Optional> findNode(final YangInstanceIdentifier rootPath, final NormalizedNode rootNode, final YangInstanceIdentifier childPath) { + final Optional relativePath = childPath.relativeTo(rootPath); if (relativePath.isPresent()) { return findNode(rootNode, relativePath.get()); } else { @@ -38,7 +38,7 @@ public final class NormalizedNodeUtils { } } - public static Optional> findNode(final NormalizedNode tree, final InstanceIdentifier path) { + public static Optional> findNode(final NormalizedNode tree, final YangInstanceIdentifier path) { checkNotNull(tree, "Tree must not be null"); checkNotNull(path, "Path must not be null"); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/SchemaUtils.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/SchemaUtils.java index bafeeaeb8a..eb6e4bbd8e 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/SchemaUtils.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/SchemaUtils.java @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.model.api.AugmentationSchema; @@ -292,7 +292,7 @@ public final class SchemaUtils { for (ChoiceCaseNode choiceCaseNode : schema.getCases()) { if (child instanceof AugmentationNode && belongsToCaseAugment(choiceCaseNode, - (InstanceIdentifier.AugmentationIdentifier) child.getIdentifier())) { + (YangInstanceIdentifier.AugmentationIdentifier) child.getIdentifier())) { return Optional.of(choiceCaseNode); } else if (choiceCaseNode.getDataChildByName(child.getNodeType()) != null) { return Optional.of(choiceCaseNode); @@ -302,7 +302,7 @@ public final class SchemaUtils { return Optional.absent(); } - public static boolean belongsToCaseAugment(final ChoiceCaseNode caseNode, final InstanceIdentifier.AugmentationIdentifier childToProcess) { + public static boolean belongsToCaseAugment(final ChoiceCaseNode caseNode, final YangInstanceIdentifier.AugmentationIdentifier childToProcess) { for (AugmentationSchema augmentationSchema : caseNode.getAvailableAugmentations()) { Set currentAugmentChildNodes = Sets.newHashSet(); @@ -318,8 +318,8 @@ public final class SchemaUtils { return false; } - public static InstanceIdentifier.AugmentationIdentifier getNodeIdentifierForAugmentation(final AugmentationSchema schema) { - return new InstanceIdentifier.AugmentationIdentifier(getChildQNames(schema)); + public static YangInstanceIdentifier.AugmentationIdentifier getNodeIdentifierForAugmentation(final AugmentationSchema schema) { + return new YangInstanceIdentifier.AugmentationIdentifier(getChildQNames(schema)); } public static Set getChildQNames(final AugmentationSchema schema) { diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/CollectionNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/CollectionNodeBuilder.java index 9972d627a1..1fa9650212 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/CollectionNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/CollectionNodeBuilder.java @@ -9,20 +9,20 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.api; import java.util.List; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -public interface CollectionNodeBuilder, R extends NormalizedNode> +public interface CollectionNodeBuilder, R extends NormalizedNode> extends NormalizedNodeContainerBuilder { @Override CollectionNodeBuilder withValue(List value); @Override - CollectionNodeBuilder withNodeIdentifier(InstanceIdentifier.NodeIdentifier nodeIdentifier); + CollectionNodeBuilder withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier nodeIdentifier); CollectionNodeBuilder withChild(V child); - CollectionNodeBuilder withoutChild(InstanceIdentifier.PathArgument key); + CollectionNodeBuilder withoutChild(YangInstanceIdentifier.PathArgument key); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/DataContainerNodeAttrBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/DataContainerNodeAttrBuilder.java index 6a441e2d20..dd950564a3 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/DataContainerNodeAttrBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/DataContainerNodeAttrBuilder.java @@ -9,16 +9,16 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.api; import java.util.List; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; -public interface DataContainerNodeAttrBuilder> +public interface DataContainerNodeAttrBuilder> extends DataContainerNodeBuilder, AttributesBuilder> { @Override - DataContainerNodeAttrBuilder withValue(List> value); + DataContainerNodeAttrBuilder withValue(List> value); @Override DataContainerNodeAttrBuilder withNodeIdentifier(I nodeIdentifier); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/DataContainerNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/DataContainerNodeBuilder.java index 136f1e40e4..a7eb3742f4 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/DataContainerNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/DataContainerNodeBuilder.java @@ -9,16 +9,16 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.api; import java.util.List; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; -public interface DataContainerNodeBuilder> +public interface DataContainerNodeBuilder> extends NormalizedNodeContainerBuilder, R> { @Override - DataContainerNodeBuilder withValue(List> value); + DataContainerNodeBuilder withValue(List> value); @Override DataContainerNodeBuilder withNodeIdentifier(I nodeIdentifier); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/ListNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/ListNodeBuilder.java index 4fde6fa22c..5844f2ee30 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/ListNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/ListNodeBuilder.java @@ -11,7 +11,7 @@ import java.util.List; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode; @@ -19,7 +19,7 @@ public interface ListNodeBuilder extends CollectionNodeBuilder, LeafSetNode> { @Override - ListNodeBuilder withNodeIdentifier(InstanceIdentifier.NodeIdentifier nodeIdentifier); + ListNodeBuilder withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier nodeIdentifier); @Override ListNodeBuilder withValue(List> value); @@ -28,7 +28,7 @@ public interface ListNodeBuilder ListNodeBuilder withChild(LeafSetEntryNode child); @Override - ListNodeBuilder withoutChild(InstanceIdentifier.PathArgument key); + ListNodeBuilder withoutChild(YangInstanceIdentifier.PathArgument key); ListNodeBuilder withChildValue(T child); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeAttrBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeAttrBuilder.java index 8863e1b4c6..99460cfdc7 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeAttrBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeAttrBuilder.java @@ -7,10 +7,10 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.builder.api; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -public interface NormalizedNodeAttrBuilder> +public interface NormalizedNodeAttrBuilder> extends AttributesBuilder>, NormalizedNodeBuilder { diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeBuilder.java index 2db9d63f97..2647dee3ab 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeBuilder.java @@ -7,10 +7,10 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.builder.api; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -public interface NormalizedNodeBuilder> { +public interface NormalizedNodeBuilder> { NormalizedNodeBuilder withValue(V value); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeContainerBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeContainerBuilder.java index 03b499538c..2409011f67 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeContainerBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/api/NormalizedNodeContainerBuilder.java @@ -2,7 +2,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.api; import java.util.List; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; public interface NormalizedNodeContainerBuilder,P extends NormalizedNode> diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeAttrBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeAttrBuilder.java index 4fef48b251..3a1a176b81 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeAttrBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeAttrBuilder.java @@ -12,13 +12,13 @@ import java.util.List; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerAttrNode; -abstract class AbstractImmutableDataContainerNodeAttrBuilder> +abstract class AbstractImmutableDataContainerNodeAttrBuilder> extends AbstractImmutableDataContainerNodeBuilder implements DataContainerNodeAttrBuilder { @@ -44,7 +44,7 @@ abstract class AbstractImmutableDataContainerNodeAttrBuilder withValue(final List> value) { + public DataContainerNodeAttrBuilder withValue(final List> value) { return (DataContainerNodeAttrBuilder) super.withValue(value); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeBuilder.java index f06f56fba1..21303e62da 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeBuilder.java @@ -11,18 +11,18 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerNode; -abstract class AbstractImmutableDataContainerNodeBuilder> +abstract class AbstractImmutableDataContainerNodeBuilder> implements DataContainerNodeBuilder { - private Map> value; + private Map> value; private I nodeIdentifier; /* @@ -65,9 +65,9 @@ abstract class AbstractImmutableDataContainerNodeBuilder withValue(final List> value) { + public DataContainerNodeBuilder withValue(final List> value) { // TODO Replace or putAll ? - for (final DataContainerChild dataContainerChild : value) { + for (final DataContainerChild dataContainerChild : value) { withChild(dataContainerChild); } return this; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableNormalizedNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableNormalizedNodeBuilder.java index 7f47679856..b9efdeb9e9 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableNormalizedNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableNormalizedNodeBuilder.java @@ -11,11 +11,11 @@ import java.util.Collections; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; -abstract class AbstractImmutableNormalizedNodeBuilder> +abstract class AbstractImmutableNormalizedNodeBuilder> implements NormalizedNodeAttrBuilder { private Map attributes = Collections.emptyMap(); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeBuilder.java index 87b7840dba..0d0ff1878d 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeBuilder.java @@ -9,15 +9,15 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableNormalizedValueAttrNode; -public class ImmutableAnyXmlNodeBuilder extends AbstractImmutableNormalizedNodeBuilder, AnyXmlNode> { +public class ImmutableAnyXmlNodeBuilder extends AbstractImmutableNormalizedNodeBuilder, AnyXmlNode> { - public static NormalizedNodeAttrBuilder, AnyXmlNode> create() { + public static NormalizedNodeAttrBuilder, AnyXmlNode> create() { return new ImmutableAnyXmlNodeBuilder(); } @@ -26,9 +26,9 @@ public class ImmutableAnyXmlNodeBuilder extends AbstractImmutableNormalizedNodeB return new ImmutableXmlNode(getNodeIdentifier(), getValue(), getAttributes()); } - private static final class ImmutableXmlNode extends AbstractImmutableNormalizedValueAttrNode> implements AnyXmlNode { + private static final class ImmutableXmlNode extends AbstractImmutableNormalizedValueAttrNode> implements AnyXmlNode { - ImmutableXmlNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, final Node value, final Map attributes) { + ImmutableXmlNode(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, final Node value, final Map attributes) { super(nodeIdentifier, value, attributes); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeSchemaAwareBuilder.java index e5316548e9..41b9b822a9 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeSchemaAwareBuilder.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; @@ -16,20 +16,20 @@ import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode; public final class ImmutableAnyXmlNodeSchemaAwareBuilder extends ImmutableAnyXmlNodeBuilder { private ImmutableAnyXmlNodeSchemaAwareBuilder(AnyXmlSchemaNode schema) { - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } - public static NormalizedNodeAttrBuilder, AnyXmlNode> create(AnyXmlSchemaNode schema) { + public static NormalizedNodeAttrBuilder, AnyXmlNode> create(AnyXmlSchemaNode schema) { return new ImmutableAnyXmlNodeSchemaAwareBuilder(schema); } @Override - public NormalizedNodeAttrBuilder, AnyXmlNode> withValue(Node value) { + public NormalizedNodeAttrBuilder, AnyXmlNode> withValue(Node value) { return super.withValue(value); } @Override - public NormalizedNodeAttrBuilder, AnyXmlNode> withNodeIdentifier(InstanceIdentifier.NodeIdentifier nodeIdentifier) { + public NormalizedNodeAttrBuilder, AnyXmlNode> withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeBuilder.java index d8f6fa9dae..a21530f784 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeBuilder.java @@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import java.util.Map; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -19,7 +19,7 @@ import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid.DataV import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerNode; public class ImmutableAugmentationNodeBuilder - extends AbstractImmutableDataContainerNodeBuilder { + extends AbstractImmutableDataContainerNodeBuilder { protected ImmutableAugmentationNodeBuilder() { super(); @@ -29,11 +29,11 @@ public class ImmutableAugmentationNodeBuilder super(node); } - public static DataContainerNodeBuilder create() { + public static DataContainerNodeBuilder create() { return new ImmutableAugmentationNodeBuilder(); } - public static DataContainerNodeBuilder create(AugmentationNode node) { + public static DataContainerNodeBuilder create(AugmentationNode node) { if (!(node instanceof ImmutableAugmentationNode)) { throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass())); } @@ -42,7 +42,7 @@ public class ImmutableAugmentationNodeBuilder } @Override - public DataContainerNodeBuilder withChild( + public DataContainerNodeBuilder withChild( final DataContainerChild child) { // Check nested augments DataValidationException.checkLegalData(child instanceof AugmentationNode == false, @@ -63,10 +63,10 @@ public class ImmutableAugmentationNodeBuilder } private static final class ImmutableAugmentationNode - extends AbstractImmutableDataContainerNode + extends AbstractImmutableDataContainerNode implements AugmentationNode { - ImmutableAugmentationNode(final InstanceIdentifier.AugmentationIdentifier nodeIdentifier, final Map> children) { + ImmutableAugmentationNode(final YangInstanceIdentifier.AugmentationIdentifier nodeIdentifier, final Map> children) { super(children, nodeIdentifier); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeSchemaAwareBuilder.java index 064c3dccd8..c83a851a3a 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeSchemaAwareBuilder.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -25,16 +25,16 @@ public class ImmutableAugmentationNodeSchemaAwareBuilder extends ImmutableAugmen } @Override - public DataContainerNodeBuilder withNodeIdentifier(InstanceIdentifier.AugmentationIdentifier nodeIdentifier) { + public DataContainerNodeBuilder withNodeIdentifier(YangInstanceIdentifier.AugmentationIdentifier nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } @Override - public DataContainerNodeBuilder withChild(DataContainerChild child) { + public DataContainerNodeBuilder withChild(DataContainerChild child) { return super.withChild(validator.validateChild(child)); } - public static DataContainerNodeBuilder create(AugmentationSchema schema) { + public static DataContainerNodeBuilder create(AugmentationSchema schema) { return new ImmutableAugmentationNodeSchemaAwareBuilder(schema); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeBuilder.java index 82cebb4f4d..8375fae86c 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeBuilder.java @@ -9,13 +9,13 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import java.util.Map; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerNode; -public class ImmutableChoiceNodeBuilder extends AbstractImmutableDataContainerNodeBuilder { +public class ImmutableChoiceNodeBuilder extends AbstractImmutableDataContainerNodeBuilder { protected ImmutableChoiceNodeBuilder() { super(); @@ -25,11 +25,11 @@ public class ImmutableChoiceNodeBuilder extends AbstractImmutableDataContainerNo super(node); } - public static DataContainerNodeBuilder create() { + public static DataContainerNodeBuilder create() { return new ImmutableChoiceNodeBuilder(); } - public static DataContainerNodeBuilder create(final ChoiceNode node) { + public static DataContainerNodeBuilder create(final ChoiceNode node) { if (!(node instanceof ImmutableChoiceNode)) { throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass())); } @@ -43,11 +43,11 @@ public class ImmutableChoiceNodeBuilder extends AbstractImmutableDataContainerNo } private static final class ImmutableChoiceNode - extends AbstractImmutableDataContainerNode + extends AbstractImmutableDataContainerNode implements ChoiceNode { - ImmutableChoiceNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, - final Map> children) { + ImmutableChoiceNode(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, + final Map> children) { super(children, nodeIdentifier); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeSchemaAwareBuilder.java index 37e2eab586..2769ddb99e 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeSchemaAwareBuilder.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import com.google.common.base.Optional; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -26,16 +26,16 @@ public class ImmutableChoiceNodeSchemaAwareBuilder extends ImmutableChoiceNodeBu protected ImmutableChoiceNodeSchemaAwareBuilder(org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) { this.schema = Preconditions.checkNotNull(schema, "Schema was null"); - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } @Override - public DataContainerNodeBuilder withNodeIdentifier(InstanceIdentifier.NodeIdentifier nodeIdentifier) { + public DataContainerNodeBuilder withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } @Override - public DataContainerNodeBuilder withChild(final DataContainerChild child) { + public DataContainerNodeBuilder withChild(final DataContainerChild child) { if(validator == null) { Optional detectedCaseOpt = SchemaUtils.detectCase(schema, child); DataValidationException.checkLegalChild(detectedCaseOpt.isPresent(), child.getIdentifier(), schema); @@ -51,7 +51,7 @@ public class ImmutableChoiceNodeSchemaAwareBuilder extends ImmutableChoiceNodeBu return super.build(); } - public static DataContainerNodeBuilder create(org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) { + public static DataContainerNodeBuilder create(org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) { return new ImmutableChoiceNodeSchemaAwareBuilder(schema); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeBuilder.java index 0518f7cf8c..288f3671f3 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeBuilder.java @@ -10,14 +10,14 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerAttrNode; public class ImmutableContainerNodeBuilder extends - AbstractImmutableDataContainerNodeAttrBuilder { + AbstractImmutableDataContainerNodeAttrBuilder { protected ImmutableContainerNodeBuilder() { super(); @@ -27,11 +27,11 @@ public class ImmutableContainerNodeBuilder extends super(node); } - public static DataContainerNodeAttrBuilder create() { + public static DataContainerNodeAttrBuilder create() { return new ImmutableContainerNodeBuilder(); } - public static DataContainerNodeAttrBuilder create(final ContainerNode node) { + public static DataContainerNodeAttrBuilder create(final ContainerNode node) { if (!(node instanceof ImmutableContainerNode)) { throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass())); } @@ -44,11 +44,11 @@ public class ImmutableContainerNodeBuilder extends } protected static final class ImmutableContainerNode extends - AbstractImmutableDataContainerAttrNode implements ContainerNode { + AbstractImmutableDataContainerAttrNode implements ContainerNode { ImmutableContainerNode( - final InstanceIdentifier.NodeIdentifier nodeIdentifier, - final Map> children, + final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, + final Map> children, final Map attributes) { super(children, nodeIdentifier, attributes); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeSchemaAwareBuilder.java index 942d02331f..c5dfffe270 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeSchemaAwareBuilder.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder; @@ -20,20 +20,20 @@ public final class ImmutableContainerNodeSchemaAwareBuilder extends ImmutableCon private ImmutableContainerNodeSchemaAwareBuilder(final ContainerSchemaNode schema) { this.validator = new DataNodeContainerValidator(schema); - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } private ImmutableContainerNodeSchemaAwareBuilder(final ContainerSchemaNode schema, final ImmutableContainerNode node) { super(node); this.validator = new DataNodeContainerValidator(schema); - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } - public static DataContainerNodeAttrBuilder create(final ContainerSchemaNode schema) { + public static DataContainerNodeAttrBuilder create(final ContainerSchemaNode schema) { return new ImmutableContainerNodeSchemaAwareBuilder(schema); } - public static DataContainerNodeAttrBuilder create(final ContainerSchemaNode schema, final ContainerNode node) { + public static DataContainerNodeAttrBuilder create(final ContainerSchemaNode schema, final ContainerNode node) { if (!(node instanceof ImmutableContainerNode)) { throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass())); } @@ -41,12 +41,12 @@ public final class ImmutableContainerNodeSchemaAwareBuilder extends ImmutableCon } @Override - public DataContainerNodeAttrBuilder withNodeIdentifier(final InstanceIdentifier.NodeIdentifier nodeIdentifier) { + public DataContainerNodeAttrBuilder withNodeIdentifier(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } @Override - public DataContainerNodeAttrBuilder withChild(final DataContainerChild child) { + public DataContainerNodeAttrBuilder withChild(final DataContainerChild child) { validator.validateChild(child.getIdentifier()); return super.withChild(child); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeBuilder.java index a127bc5e0b..1d14eefe7a 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeBuilder.java @@ -10,14 +10,14 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableNormalizedValueAttrNode; -public class ImmutableLeafNodeBuilder extends AbstractImmutableNormalizedNodeBuilder> { +public class ImmutableLeafNodeBuilder extends AbstractImmutableNormalizedNodeBuilder> { - public static NormalizedNodeAttrBuilder> create() { + public static NormalizedNodeAttrBuilder> create() { return new ImmutableLeafNodeBuilder<>(); } @@ -26,9 +26,9 @@ public class ImmutableLeafNodeBuilder extends AbstractImmutableNormalizedNode return new ImmutableLeafNode<>(getNodeIdentifier(), getValue(), getAttributes()); } - private static final class ImmutableLeafNode extends AbstractImmutableNormalizedValueAttrNode implements LeafNode { + private static final class ImmutableLeafNode extends AbstractImmutableNormalizedValueAttrNode implements LeafNode { - ImmutableLeafNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, final T value, final Map attributes) { + ImmutableLeafNode(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, final T value, final Map attributes) { super(nodeIdentifier, value, attributes); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeSchemaAwareBuilder.java index 3c508fe01c..5ded713cfe 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeSchemaAwareBuilder.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; @@ -15,21 +15,21 @@ import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; public final class ImmutableLeafNodeSchemaAwareBuilder extends ImmutableLeafNodeBuilder { private ImmutableLeafNodeSchemaAwareBuilder(LeafSchemaNode schema) { - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } - public static NormalizedNodeAttrBuilder> create(LeafSchemaNode schema) { + public static NormalizedNodeAttrBuilder> create(LeafSchemaNode schema) { return new ImmutableLeafNodeSchemaAwareBuilder<>(schema); } @Override - public NormalizedNodeAttrBuilder> withValue(T value) { + public NormalizedNodeAttrBuilder> withValue(T value) { // TODO check value type return super.withValue(value); } @Override - public NormalizedNodeAttrBuilder> withNodeIdentifier(InstanceIdentifier.NodeIdentifier nodeIdentifier) { + public NormalizedNodeAttrBuilder> withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeBuilder.java index ba351f1348..219f58c522 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeBuilder.java @@ -10,13 +10,13 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableNormalizedValueAttrNode; import com.google.common.base.Preconditions; -public class ImmutableLeafSetEntryNodeBuilder extends AbstractImmutableNormalizedNodeBuilder> { +public class ImmutableLeafSetEntryNodeBuilder extends AbstractImmutableNormalizedNodeBuilder> { public static ImmutableLeafSetEntryNodeBuilder create() { return new ImmutableLeafSetEntryNodeBuilder<>(); @@ -27,9 +27,9 @@ public class ImmutableLeafSetEntryNodeBuilder extends AbstractImmutableNormal return new ImmutableLeafSetEntryNode<>(getNodeIdentifier(), getValue(), getAttributes()); } - private static final class ImmutableLeafSetEntryNode extends AbstractImmutableNormalizedValueAttrNode implements LeafSetEntryNode { + private static final class ImmutableLeafSetEntryNode extends AbstractImmutableNormalizedValueAttrNode implements LeafSetEntryNode { - ImmutableLeafSetEntryNode(final InstanceIdentifier.NodeWithValue nodeIdentifier, final T value, final Map attributes) { + ImmutableLeafSetEntryNode(final YangInstanceIdentifier.NodeWithValue nodeIdentifier, final T value, final Map attributes) { super(nodeIdentifier, value, attributes); Preconditions.checkArgument(nodeIdentifier.getValue().equals(value), "Node identifier contains different value: %s than value itself: %s", nodeIdentifier, value); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeSchemaAwareBuilder.java index 75ffab258c..421b951e72 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeSchemaAwareBuilder.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; @@ -22,19 +22,19 @@ public final class ImmutableLeafSetEntryNodeSchemaAwareBuilder extends Immuta this.schema = Preconditions.checkNotNull(schema); } - public static NormalizedNodeAttrBuilder> create(LeafListSchemaNode schema) { + public static NormalizedNodeAttrBuilder> create(LeafListSchemaNode schema) { return new ImmutableLeafSetEntryNodeSchemaAwareBuilder<>(schema); } @Override - public NormalizedNodeAttrBuilder> withValue(T value) { - super.withNodeIdentifier(new InstanceIdentifier.NodeWithValue(schema.getQName(), value)); + public NormalizedNodeAttrBuilder> withValue(T value) { + super.withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue(schema.getQName(), value)); // TODO check value type using TypeProvider ? return super.withValue(value); } @Override - public NormalizedNodeAttrBuilder> withNodeIdentifier(InstanceIdentifier.NodeWithValue nodeIdentifier) { + public NormalizedNodeAttrBuilder> withNodeIdentifier(YangInstanceIdentifier.NodeWithValue nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeBuilder.java index 6d04d5989c..dd5048103c 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeBuilder.java @@ -15,9 +15,9 @@ import java.util.Map; import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.util.MapAdaptor; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.ListNodeBuilder; @@ -30,8 +30,8 @@ import com.google.common.collect.Iterables; public class ImmutableLeafSetNodeBuilder implements ListNodeBuilder> { - private final Map> value; - private InstanceIdentifier.NodeIdentifier nodeIdentifier; + private final Map> value; + private YangInstanceIdentifier.NodeIdentifier nodeIdentifier; protected ImmutableLeafSetNodeBuilder() { value = new HashMap<>(); @@ -73,7 +73,7 @@ public class ImmutableLeafSetNodeBuilder implements ListNodeBuilder> withNodeIdentifier( - final InstanceIdentifier.NodeIdentifier nodeIdentifier) { + final YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { this.nodeIdentifier = nodeIdentifier; return this; } @@ -90,7 +90,7 @@ public class ImmutableLeafSetNodeBuilder implements ListNodeBuilder> withChildValue(final T value, final Map attributes) { final ImmutableLeafSetEntryNodeBuilder b = ImmutableLeafSetEntryNodeBuilder.create(); - b.withNodeIdentifier(new InstanceIdentifier.NodeWithValue(nodeIdentifier.getNodeType(), value)); + b.withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue(nodeIdentifier.getNodeType(), value)); b.withValue(value); b.withAttributes(attributes); return withChild(b.build()); @@ -102,19 +102,19 @@ public class ImmutableLeafSetNodeBuilder implements ListNodeBuilder extends - AbstractImmutableNormalizedValueNode>> implements + AbstractImmutableNormalizedValueNode>> implements Immutable, LeafSetNode { - private final Map> children; + private final Map> children; - ImmutableLeafSetNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, - final Map> children) { + ImmutableLeafSetNode(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, + final Map> children) { super(nodeIdentifier, Iterables.unmodifiableIterable(children.values())); this.children = children; } @Override - public Optional> getChild(final InstanceIdentifier.NodeWithValue child) { + public Optional> getChild(final YangInstanceIdentifier.NodeWithValue child) { return Optional.fromNullable(children.get(child)); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeSchemaAwareBuilder.java index 92990169d7..e636a4ac4f 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeSchemaAwareBuilder.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import com.google.common.collect.Sets; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.ListNodeBuilder; @@ -23,14 +23,14 @@ public final class ImmutableLeafSetNodeSchemaAwareBuilder extends ImmutableLe private ImmutableLeafSetNodeSchemaAwareBuilder(final LeafListSchemaNode schema) { this.schema = Preconditions.checkNotNull(schema); - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } public ImmutableLeafSetNodeSchemaAwareBuilder(final LeafListSchemaNode schema, final ImmutableLeafSetNode node) { super(node); this.schema = Preconditions.checkNotNull(schema); // FIXME: Preconditions.checkArgument(schema.getQName().equals(node.getIdentifier())); - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } public static ListNodeBuilder> create(final LeafListSchemaNode schema) { @@ -61,7 +61,7 @@ public final class ImmutableLeafSetNodeSchemaAwareBuilder extends ImmutableLe } @Override - public ListNodeBuilder> withNodeIdentifier(final InstanceIdentifier.NodeIdentifier nodeIdentifier) { + public ListNodeBuilder> withNodeIdentifier(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeBuilder.java index 08d680eeec..cd9e6effb3 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeBuilder.java @@ -12,8 +12,8 @@ import java.util.List; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder; @@ -21,9 +21,9 @@ import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid.DataV import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerAttrNode; public class ImmutableMapEntryNodeBuilder - extends AbstractImmutableDataContainerNodeAttrBuilder { + extends AbstractImmutableDataContainerNodeAttrBuilder { - protected final Map childrenQNamesToPaths; + protected final Map childrenQNamesToPaths; protected ImmutableMapEntryNodeBuilder() { this.childrenQNamesToPaths = new LinkedHashMap<>(); @@ -35,11 +35,11 @@ public class ImmutableMapEntryNodeBuilder fillQnames(node.getValue(), childrenQNamesToPaths); } - public static DataContainerNodeAttrBuilder create() { + public static DataContainerNodeAttrBuilder create() { return new ImmutableMapEntryNodeBuilder(); } - public static DataContainerNodeAttrBuilder create(final MapEntryNode node) { + public static DataContainerNodeAttrBuilder create(final MapEntryNode node) { if (!(node instanceof ImmutableMapEntryNode)) { throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass())); } @@ -48,8 +48,8 @@ public class ImmutableMapEntryNodeBuilder } private static void fillQnames(final Iterable> iterable, final Map out) { - for (final DataContainerChild childId : iterable) { - final InstanceIdentifier.PathArgument identifier = childId.getIdentifier(); + for (final DataContainerChild childId : iterable) { + final YangInstanceIdentifier.PathArgument identifier = childId.getIdentifier(); // Augmentation nodes cannot be keys, and do not have to be present in childrenQNamesToPaths map if(isAugment(identifier)) { @@ -62,17 +62,17 @@ public class ImmutableMapEntryNodeBuilder @Override - public DataContainerNodeAttrBuilder withValue(final List> value) { + public DataContainerNodeAttrBuilder withValue(final List> value) { fillQnames(value, childrenQNamesToPaths); return super.withValue(value); } - private static boolean isAugment(InstanceIdentifier.PathArgument identifier) { - return identifier instanceof InstanceIdentifier.AugmentationIdentifier; + private static boolean isAugment(YangInstanceIdentifier.PathArgument identifier) { + return identifier instanceof YangInstanceIdentifier.AugmentationIdentifier; } @Override - public DataContainerNodeAttrBuilder withChild(final DataContainerChild child) { + public DataContainerNodeAttrBuilder withChild(final DataContainerChild child) { // Augmentation nodes cannot be keys, and do not have to be present in childrenQNamesToPaths map if(isAugment(child.getIdentifier()) == false) { childrenQNamesToPaths.put(child.getNodeType(), child.getIdentifier()); @@ -94,10 +94,10 @@ public class ImmutableMapEntryNodeBuilder } } - private static final class ImmutableMapEntryNode extends AbstractImmutableDataContainerAttrNode implements MapEntryNode { + private static final class ImmutableMapEntryNode extends AbstractImmutableDataContainerAttrNode implements MapEntryNode { - ImmutableMapEntryNode(final InstanceIdentifier.NodeIdentifierWithPredicates nodeIdentifier, - final Map> children, final Map attributes) { + ImmutableMapEntryNode(final YangInstanceIdentifier.NodeIdentifierWithPredicates nodeIdentifier, + final Map> children, final Map attributes) { super(children, nodeIdentifier, attributes); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeSchemaAwareBuilder.java index f60bead655..c2f81c14a4 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeSchemaAwareBuilder.java @@ -11,7 +11,7 @@ import java.util.Collection; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder; @@ -33,12 +33,12 @@ public final class ImmutableMapEntryNodeSchemaAwareBuilder extends ImmutableMapE } @Override - public ImmutableMapEntryNodeBuilder withNodeIdentifier(final InstanceIdentifier.NodeIdentifierWithPredicates nodeIdentifier) { + public ImmutableMapEntryNodeBuilder withNodeIdentifier(final YangInstanceIdentifier.NodeIdentifierWithPredicates nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } @Override - public DataContainerNodeAttrBuilder withChild(final DataContainerChild child) { + public DataContainerNodeAttrBuilder withChild(final DataContainerChild child) { validator.validateChild(child.getIdentifier()); return super.withChild(child); } @@ -52,7 +52,7 @@ public final class ImmutableMapEntryNodeSchemaAwareBuilder extends ImmutableMapE /** * Build map entry node identifier from schema, and provided children */ - private InstanceIdentifier.NodeIdentifierWithPredicates constructNodeIdentifier() { + private YangInstanceIdentifier.NodeIdentifierWithPredicates constructNodeIdentifier() { Collection keys = schema.getKeyDefinition(); if(keys.isEmpty()) { @@ -62,15 +62,15 @@ public final class ImmutableMapEntryNodeSchemaAwareBuilder extends ImmutableMapE final Map keysToValues = Maps.newHashMap(); for (QName key : keys) { final DataContainerChild valueForKey = getChild(childrenQNamesToPaths.get(key)); - DataValidationException.checkListKey(valueForKey, key, new InstanceIdentifier.NodeIdentifierWithPredicates( + DataValidationException.checkListKey(valueForKey, key, new YangInstanceIdentifier.NodeIdentifierWithPredicates( schema.getQName(), keysToValues)); keysToValues.put(key, valueForKey.getValue()); } - return new InstanceIdentifier.NodeIdentifierWithPredicates(schema.getQName(), keysToValues); + return new YangInstanceIdentifier.NodeIdentifierWithPredicates(schema.getQName(), keysToValues); } - public static DataContainerNodeAttrBuilder create(final ListSchemaNode schema) { + public static DataContainerNodeAttrBuilder create(final ListSchemaNode schema) { return new ImmutableMapEntryNodeSchemaAwareBuilder(schema); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeBuilder.java index 4a52f95d3e..98028944ff 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeBuilder.java @@ -13,9 +13,9 @@ import java.util.Map; import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.util.MapAdaptor; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder; @@ -28,8 +28,8 @@ import com.google.common.collect.Iterables; public class ImmutableMapNodeBuilder implements CollectionNodeBuilder { - private final Map value; - private InstanceIdentifier.NodeIdentifier nodeIdentifier; + private final Map value; + private YangInstanceIdentifier.NodeIdentifier nodeIdentifier; protected ImmutableMapNodeBuilder() { this.value = new HashMap<>(); @@ -59,7 +59,7 @@ public class ImmutableMapNodeBuilder } @Override - public CollectionNodeBuilder withoutChild(final InstanceIdentifier.PathArgument key) { + public CollectionNodeBuilder withoutChild(final YangInstanceIdentifier.PathArgument key) { this.value.remove(key); return this; } @@ -75,7 +75,7 @@ public class ImmutableMapNodeBuilder } @Override - public CollectionNodeBuilder withNodeIdentifier(final InstanceIdentifier.NodeIdentifier nodeIdentifier) { + public CollectionNodeBuilder withNodeIdentifier(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { this.nodeIdentifier = nodeIdentifier; return this; } @@ -98,18 +98,18 @@ public class ImmutableMapNodeBuilder return withoutChild(key); } - protected static final class ImmutableMapNode extends AbstractImmutableNormalizedNode> implements Immutable,MapNode { + protected static final class ImmutableMapNode extends AbstractImmutableNormalizedNode> implements Immutable,MapNode { - private final Map children; + private final Map children; - ImmutableMapNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, - final Map children) { + ImmutableMapNode(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, + final Map children) { super(nodeIdentifier); this.children = children; } @Override - public Optional getChild(final InstanceIdentifier.NodeIdentifierWithPredicates child) { + public Optional getChild(final YangInstanceIdentifier.NodeIdentifierWithPredicates child) { return Optional.fromNullable(children.get(child)); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeSchemaAwareBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeSchemaAwareBuilder.java index bc622e18f8..141389c52a 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeSchemaAwareBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeSchemaAwareBuilder.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import com.google.common.collect.Sets; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder; @@ -23,13 +23,13 @@ public class ImmutableMapNodeSchemaAwareBuilder extends ImmutableMapNodeBuilder protected ImmutableMapNodeSchemaAwareBuilder(final ListSchemaNode schema) { this.schema = Preconditions.checkNotNull(schema); - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } protected ImmutableMapNodeSchemaAwareBuilder(final ListSchemaNode schema, final ImmutableMapNode node) { super(node); this.schema = Preconditions.checkNotNull(schema); - super.withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schema.getQName())); + super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName())); } public static CollectionNodeBuilder create(final ListSchemaNode schema) { @@ -51,7 +51,7 @@ public class ImmutableMapNodeSchemaAwareBuilder extends ImmutableMapNodeBuilder } @Override - public CollectionNodeBuilder withNodeIdentifier(final InstanceIdentifier.NodeIdentifier nodeIdentifier) { + public CollectionNodeBuilder withNodeIdentifier(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { throw new UnsupportedOperationException("Node identifier created from schema"); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedLeafSetNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedLeafSetNodeBuilder.java index c440bd7f8d..9876bbe341 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedLeafSetNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedLeafSetNodeBuilder.java @@ -14,9 +14,9 @@ import java.util.Map; import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode; import org.opendaylight.yangtools.yang.data.api.schema.OrderedLeafSetNode; @@ -29,8 +29,8 @@ import com.google.common.collect.Iterables; public class ImmutableOrderedLeafSetNodeBuilder implements ListNodeBuilder> { - private Map> value; - private InstanceIdentifier.NodeIdentifier nodeIdentifier; + private Map> value; + private YangInstanceIdentifier.NodeIdentifier nodeIdentifier; private boolean dirty; protected ImmutableOrderedLeafSetNodeBuilder() { @@ -85,7 +85,7 @@ public class ImmutableOrderedLeafSetNodeBuilder implements ListNodeBuilder> withNodeIdentifier( - final InstanceIdentifier.NodeIdentifier nodeIdentifier) { + final YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { this.nodeIdentifier = nodeIdentifier; return this; } @@ -103,7 +103,7 @@ public class ImmutableOrderedLeafSetNodeBuilder implements ListNodeBuilder> withChildValue(final T value, final Map attributes) { final ImmutableLeafSetEntryNodeBuilder b = ImmutableLeafSetEntryNodeBuilder.create(); - b.withNodeIdentifier(new InstanceIdentifier.NodeWithValue(nodeIdentifier.getNodeType(), value)); + b.withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue(nodeIdentifier.getNodeType(), value)); b.withValue(value); b.withAttributes(attributes); return withChild(b.build()); @@ -115,19 +115,19 @@ public class ImmutableOrderedLeafSetNodeBuilder implements ListNodeBuilder extends - AbstractImmutableNormalizedNode>> implements + AbstractImmutableNormalizedNode>> implements Immutable, OrderedLeafSetNode { - private final Map> children; + private final Map> children; - ImmutableOrderedLeafSetNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, - final Map> children) { + ImmutableOrderedLeafSetNode(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, + final Map> children) { super(nodeIdentifier); this.children = children; } @Override - public Optional> getChild(final InstanceIdentifier.NodeWithValue child) { + public Optional> getChild(final YangInstanceIdentifier.NodeWithValue child) { return Optional.fromNullable(children.get(child)); } @@ -136,7 +136,7 @@ public class ImmutableOrderedLeafSetNodeBuilder implements ListNodeBuilder> getChildren() { + private Map> getChildren() { return Collections.unmodifiableMap(children); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedMapNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedMapNodeBuilder.java index ca0ea95365..272a678438 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedMapNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedMapNodeBuilder.java @@ -12,9 +12,9 @@ import java.util.List; import java.util.Map; import org.opendaylight.yangtools.concepts.Immutable; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.OrderedMapNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder; @@ -27,8 +27,8 @@ import com.google.common.collect.Iterables; public class ImmutableOrderedMapNodeBuilder implements CollectionNodeBuilder { - private Map value; - private InstanceIdentifier.NodeIdentifier nodeIdentifier; + private Map value; + private YangInstanceIdentifier.NodeIdentifier nodeIdentifier; private boolean dirty = false; protected ImmutableOrderedMapNodeBuilder() { @@ -69,7 +69,7 @@ public class ImmutableOrderedMapNodeBuilder } @Override - public CollectionNodeBuilder withoutChild(final InstanceIdentifier.PathArgument key) { + public CollectionNodeBuilder withoutChild(final YangInstanceIdentifier.PathArgument key) { checkDirty(); this.value.remove(key); return this; @@ -86,7 +86,7 @@ public class ImmutableOrderedMapNodeBuilder } @Override - public CollectionNodeBuilder withNodeIdentifier(final InstanceIdentifier.NodeIdentifier nodeIdentifier) { + public CollectionNodeBuilder withNodeIdentifier(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { this.nodeIdentifier = nodeIdentifier; return this; } @@ -110,18 +110,18 @@ public class ImmutableOrderedMapNodeBuilder return withoutChild(key); } - protected static final class ImmutableOrderedMapNode extends AbstractImmutableNormalizedNode> implements Immutable,OrderedMapNode { + protected static final class ImmutableOrderedMapNode extends AbstractImmutableNormalizedNode> implements Immutable,OrderedMapNode { - private final Map children; + private final Map children; - ImmutableOrderedMapNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, - final Map children) { + ImmutableOrderedMapNode(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, + final Map children) { super(nodeIdentifier); this.children = children; } @Override - public Optional getChild(final InstanceIdentifier.NodeIdentifierWithPredicates child) { + public Optional getChild(final YangInstanceIdentifier.NodeIdentifierWithPredicates child) { return Optional.fromNullable(children.get(child)); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListEntryNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListEntryNodeBuilder.java index 7ea2429ebe..8952c2c580 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListEntryNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListEntryNodeBuilder.java @@ -10,14 +10,14 @@ package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder; import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerAttrNode; public class ImmutableUnkeyedListEntryNodeBuilder extends - AbstractImmutableDataContainerNodeAttrBuilder { + AbstractImmutableDataContainerNodeAttrBuilder { protected ImmutableUnkeyedListEntryNodeBuilder() { super(); @@ -27,11 +27,11 @@ public class ImmutableUnkeyedListEntryNodeBuilder extends super(node); } - public static DataContainerNodeAttrBuilder create() { + public static DataContainerNodeAttrBuilder create() { return new ImmutableUnkeyedListEntryNodeBuilder(); } - public static DataContainerNodeAttrBuilder create(final UnkeyedListEntryNode node) { + public static DataContainerNodeAttrBuilder create(final UnkeyedListEntryNode node) { if (!(node instanceof ImmutableUnkeyedListEntryNode)) { throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass())); } @@ -44,11 +44,11 @@ public class ImmutableUnkeyedListEntryNodeBuilder extends } protected static final class ImmutableUnkeyedListEntryNode extends - AbstractImmutableDataContainerAttrNode implements UnkeyedListEntryNode { + AbstractImmutableDataContainerAttrNode implements UnkeyedListEntryNode { ImmutableUnkeyedListEntryNode( - final InstanceIdentifier.NodeIdentifier nodeIdentifier, - final Map> children, + final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, + final Map> children, final Map attributes) { super(children, nodeIdentifier, attributes); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListNodeBuilder.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListNodeBuilder.java index 274b781d3e..66f81cadff 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListNodeBuilder.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListNodeBuilder.java @@ -11,9 +11,9 @@ import java.util.LinkedList; import java.util.List; import org.opendaylight.yangtools.concepts.Immutable; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder; @@ -27,7 +27,7 @@ import com.google.common.collect.Iterables; public class ImmutableUnkeyedListNodeBuilder implements CollectionNodeBuilder { private List value; - private InstanceIdentifier.NodeIdentifier nodeIdentifier; + private YangInstanceIdentifier.NodeIdentifier nodeIdentifier; private boolean dirty = false; protected ImmutableUnkeyedListNodeBuilder() { @@ -70,7 +70,7 @@ public class ImmutableUnkeyedListNodeBuilder implements CollectionNodeBuilder withoutChild( - final InstanceIdentifier.PathArgument key) { + final YangInstanceIdentifier.PathArgument key) { checkDirty(); throw new UnsupportedOperationException("Children does not have identifiers."); } @@ -87,7 +87,7 @@ public class ImmutableUnkeyedListNodeBuilder implements CollectionNodeBuilder withNodeIdentifier( - final InstanceIdentifier.NodeIdentifier nodeIdentifier) { + final YangInstanceIdentifier.NodeIdentifier nodeIdentifier) { this.nodeIdentifier = nodeIdentifier; return this; } @@ -110,12 +110,12 @@ public class ImmutableUnkeyedListNodeBuilder implements CollectionNodeBuilder> + AbstractImmutableNormalizedValueNode> implements Immutable, UnkeyedListNode { private final ImmutableList children; - ImmutableUnkeyedListNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier, + ImmutableUnkeyedListNode(final YangInstanceIdentifier.NodeIdentifier nodeIdentifier, final ImmutableList children) { super(nodeIdentifier, children); this.children = children; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/valid/DataNodeContainerValidator.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/valid/DataNodeContainerValidator.java index 6deb106a79..e48f5c2592 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/valid/DataNodeContainerValidator.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/valid/DataNodeContainerValidator.java @@ -11,7 +11,7 @@ import java.util.Set; import com.google.common.collect.Sets; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.SchemaUtils; import org.opendaylight.yangtools.yang.model.api.AugmentationSchema; @@ -29,7 +29,7 @@ public class DataNodeContainerValidator { private final DataNodeContainer schema; private final Set childNodes; - private final Set augments = Sets.newHashSet(); + private final Set augments = Sets.newHashSet(); public DataNodeContainerValidator(DataNodeContainer schema) { this.schema = Preconditions.checkNotNull(schema, "Schema was null"); @@ -43,15 +43,15 @@ public class DataNodeContainerValidator { } } - private boolean isKnownChild(InstanceIdentifier.PathArgument child) { - if(child instanceof InstanceIdentifier.AugmentationIdentifier) { + private boolean isKnownChild(YangInstanceIdentifier.PathArgument child) { + if(child instanceof YangInstanceIdentifier.AugmentationIdentifier) { return augments.contains(child); } return childNodes.contains(child.getNodeType()); } - public void validateChild(InstanceIdentifier.PathArgument child) { + public void validateChild(YangInstanceIdentifier.PathArgument child) { DataValidationException.checkLegalChild(isKnownChild(child), child, schema, childNodes, augments); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/valid/DataValidationException.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/valid/DataValidationException.java index beac387a60..493c6ceec0 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/valid/DataValidationException.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/valid/DataValidationException.java @@ -11,7 +11,7 @@ import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.model.api.ChoiceNode; import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; @@ -24,21 +24,21 @@ public class DataValidationException extends RuntimeException { super(message); } - public static void checkLegalChild(final boolean isLegal, final InstanceIdentifier.PathArgument child, final DataNodeContainer schema, - final Set childNodes, final Set augments) { + public static void checkLegalChild(final boolean isLegal, final YangInstanceIdentifier.PathArgument child, final DataNodeContainer schema, + final Set childNodes, final Set augments) { if (isLegal == false) { throw new IllegalChildException(child, schema, childNodes, augments); } } - public static void checkLegalChild(final boolean isLegal, final InstanceIdentifier.PathArgument child, final DataSchemaNode schema, + public static void checkLegalChild(final boolean isLegal, final YangInstanceIdentifier.PathArgument child, final DataSchemaNode schema, final Set childNodes) { if (isLegal == false) { throw new IllegalChildException(child, schema, childNodes); } } - public static void checkLegalChild(final boolean isLegal, final InstanceIdentifier.PathArgument child, final ChoiceNode schema) { + public static void checkLegalChild(final boolean isLegal, final YangInstanceIdentifier.PathArgument child, final ChoiceNode schema) { if (isLegal == false) { throw new IllegalChildException(child, schema); } @@ -51,7 +51,7 @@ public class DataValidationException extends RuntimeException { } public static void checkListKey(final DataContainerChild childNode, final Map keyValues, final QName keyQName, - final InstanceIdentifier.NodeIdentifierWithPredicates nodeId) { + final YangInstanceIdentifier.NodeIdentifierWithPredicates nodeId) { checkListKey(childNode, keyQName, nodeId); Object expectedValue = nodeId.getKeyValues().get(keyQName); @@ -61,7 +61,7 @@ public class DataValidationException extends RuntimeException { } } - public static void checkListKey(final DataContainerChild childNode, final QName keyQName, final InstanceIdentifier.NodeIdentifierWithPredicates nodeId) { + public static void checkListKey(final DataContainerChild childNode, final QName keyQName, final YangInstanceIdentifier.NodeIdentifierWithPredicates nodeId) { if (childNode == null) { throw new IllegalListKeyException(keyQName, nodeId); } @@ -70,17 +70,17 @@ public class DataValidationException extends RuntimeException { static final class IllegalChildException extends DataValidationException { private static final long serialVersionUID = 1L; - public IllegalChildException(final InstanceIdentifier.PathArgument child, final DataNodeContainer schema, - final Set childNodes, final Set augments) { + public IllegalChildException(final YangInstanceIdentifier.PathArgument child, final DataNodeContainer schema, + final Set childNodes, final Set augments) { super(String.format("Unknown child node: %s, does not belong to: %s as a direct child. " + "Direct child nodes: %s, augmented child nodes: %s", child, schema, childNodes, augments)); } - public IllegalChildException(final InstanceIdentifier.PathArgument child, final ChoiceNode schema) { + public IllegalChildException(final YangInstanceIdentifier.PathArgument child, final ChoiceNode schema) { super(String.format("Unknown child node: %s, not detected in choice: %s", child, schema)); } - public IllegalChildException(final InstanceIdentifier.PathArgument child, final DataSchemaNode schema, final Set childNodes) { + public IllegalChildException(final YangInstanceIdentifier.PathArgument child, final DataSchemaNode schema, final Set childNodes) { super(String.format("Unknown child node: %s, does not belong to: %s as a child. " + "Child nodes: %s", child, schema, childNodes)); } @@ -89,11 +89,11 @@ public class DataValidationException extends RuntimeException { static final class IllegalListKeyException extends DataValidationException { private static final long serialVersionUID = 1L; - public IllegalListKeyException(final QName keyQName, final InstanceIdentifier.NodeIdentifierWithPredicates id) { + public IllegalListKeyException(final QName keyQName, final YangInstanceIdentifier.NodeIdentifierWithPredicates id) { super(String.format("Key value not present for key: %s, in: %s", keyQName, id)); } - public IllegalListKeyException(final QName keyQName, final InstanceIdentifier.NodeIdentifierWithPredicates id, final Object actualValue, final Object expectedValue) { + public IllegalListKeyException(final QName keyQName, final YangInstanceIdentifier.NodeIdentifierWithPredicates id, final Object actualValue, final Object expectedValue) { super(String.format("Illegal value for key: %s, in: %s, actual value: %s, expected value from key: %s", keyQName, id, actualValue, expectedValue)); } } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerAttrNode.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerAttrNode.java index 85d4a8ed7a..1aa5f9a058 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerAttrNode.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerAttrNode.java @@ -11,19 +11,19 @@ import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.AttributesContainer; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import com.google.common.base.Objects.ToStringHelper; -public abstract class AbstractImmutableDataContainerAttrNode +public abstract class AbstractImmutableDataContainerAttrNode extends AbstractImmutableDataContainerNode implements AttributesContainer { private final Map attributes; public AbstractImmutableDataContainerAttrNode( - final Map> children, + final Map> children, final K nodeIdentifier, final Map attributes) { super(children, nodeIdentifier); this.attributes = attributes; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerNode.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerNode.java index b2abac6cc7..cd43988642 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerNode.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerNode.java @@ -13,7 +13,7 @@ import java.util.Collections; import java.util.Map; import org.opendaylight.yangtools.concepts.Immutable; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedNode.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedNode.java index d5a6a2b501..ac9b030655 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedNode.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedNode.java @@ -13,10 +13,10 @@ import com.google.common.base.Preconditions; import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -public abstract class AbstractImmutableNormalizedNode implements NormalizedNode, Immutable { +public abstract class AbstractImmutableNormalizedNode implements NormalizedNode, Immutable { private final K nodeIdentifier; protected AbstractImmutableNormalizedNode(final K nodeIdentifier) { diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueAttrNode.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueAttrNode.java index fa81857ee2..acfb07c49f 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueAttrNode.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueAttrNode.java @@ -11,12 +11,12 @@ import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.AttributesContainer; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import com.google.common.base.Objects.ToStringHelper; import com.google.common.collect.ImmutableMap; -public abstract class AbstractImmutableNormalizedValueAttrNode +public abstract class AbstractImmutableNormalizedValueAttrNode extends AbstractImmutableNormalizedValueNode implements AttributesContainer { diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueNode.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueNode.java index f5e9ba67ee..beb797975c 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueNode.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueNode.java @@ -7,11 +7,11 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.nodes; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public abstract class AbstractImmutableNormalizedValueNode extends +public abstract class AbstractImmutableNormalizedValueNode extends AbstractImmutableNormalizedNode { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractImmutableNormalizedValueNode.class); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/AugmentationNodeBaseParser.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/AugmentationNodeBaseParser.java index 5210bc8db6..310ef838bd 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/AugmentationNodeBaseParser.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/AugmentationNodeBaseParser.java @@ -12,7 +12,7 @@ import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -30,7 +30,7 @@ public abstract class AugmentationNodeBaseParser extends BaseDispatcherParser { @Override - protected final DataContainerNodeBuilder getBuilder(AugmentationSchema schema) { + protected final DataContainerNodeBuilder getBuilder(AugmentationSchema schema) { return Builders.augmentationBuilder(schema); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/BaseDispatcherParser.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/BaseDispatcherParser.java index 9101c2bdbd..9de1b823ac 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/BaseDispatcherParser.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/BaseDispatcherParser.java @@ -13,7 +13,7 @@ import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.AttributesBuilder; @@ -123,7 +123,7 @@ public abstract class BaseDispatcherParser, S> choicesToElements.putAll(choiceSchema, childrenForQName); // Regular child nodes } else { - DataContainerChild builtChildNode = getDispatcher() + DataContainerChild builtChildNode = getDispatcher() .dispatchChildElement(childSchema, childrenForQName); containerBuilder.withChild(builtChildNode); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ChoiceNodeBaseParser.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ChoiceNodeBaseParser.java index 036d27ce65..c003ed5e5f 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ChoiceNodeBaseParser.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ChoiceNodeBaseParser.java @@ -11,7 +11,7 @@ import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -33,7 +33,7 @@ public abstract class ChoiceNodeBaseParser extends BaseDispatcherParser { @Override - protected final DataContainerNodeBuilder getBuilder( + protected final DataContainerNodeBuilder getBuilder( org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) { return Builders.choiceBuilder(schema); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ContainerNodeBaseParser.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ContainerNodeBaseParser.java index f3fdc55fdd..05213f9e36 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ContainerNodeBaseParser.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ContainerNodeBaseParser.java @@ -11,7 +11,7 @@ import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -31,7 +31,7 @@ public abstract class ContainerNodeBaseParser extends BaseDispatcherParser { @Override - protected final DataContainerNodeBuilder getBuilder( + protected final DataContainerNodeBuilder getBuilder( ContainerSchemaNode schema) { return Builders.containerBuilder(schema); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/LeafNodeBaseParser.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/LeafNodeBaseParser.java index a6c309174b..4056d1da18 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/LeafNodeBaseParser.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/LeafNodeBaseParser.java @@ -10,7 +10,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; @@ -36,7 +36,7 @@ public abstract class LeafNodeBaseParser implements final E e = elements.iterator().next(); Object value = parseLeaf(e, schema); - NormalizedNodeAttrBuilder> leafBuilder = Builders.leafBuilder(schema); + NormalizedNodeAttrBuilder> leafBuilder = Builders.leafBuilder(schema); leafBuilder.withAttributes(getAttributes(e)); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/LeafSetEntryNodeBaseParser.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/LeafSetEntryNodeBaseParser.java index f127209974..526cdf8615 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/LeafSetEntryNodeBaseParser.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/LeafSetEntryNodeBaseParser.java @@ -10,7 +10,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser; import java.util.Map; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder; @@ -36,7 +36,7 @@ public abstract class LeafSetEntryNodeBaseParser implements final E e = elements.iterator().next(); Object value = parseLeafListEntry(e,schema); - NormalizedNodeAttrBuilder> leafEntryBuilder = Builders + NormalizedNodeAttrBuilder> leafEntryBuilder = Builders .leafSetEntryBuilder(schema); leafEntryBuilder.withAttributes(getAttributes(e)); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/MapEntryNodeBaseParser.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/MapEntryNodeBaseParser.java index d555b006ad..de6c475773 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/MapEntryNodeBaseParser.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/MapEntryNodeBaseParser.java @@ -11,7 +11,7 @@ import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -30,7 +30,7 @@ import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; public abstract class MapEntryNodeBaseParser extends BaseDispatcherParser { @Override - protected final DataContainerNodeBuilder getBuilder( + protected final DataContainerNodeBuilder getBuilder( ListSchemaNode schema) { return Builders.mapEntryBuilder(schema); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/AugmentationNodeBaseSerializer.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/AugmentationNodeBaseSerializer.java index dc75ca61d6..10f7b81e22 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/AugmentationNodeBaseSerializer.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/AugmentationNodeBaseSerializer.java @@ -9,7 +9,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializ import java.util.Set; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.SchemaUtils; @@ -31,7 +31,7 @@ public abstract class AugmentationNodeBaseSerializer extends @Override protected DataSchemaNode getSchemaForChild(AugmentationSchema schema, - DataContainerChild childNode) { + DataContainerChild childNode) { return SchemaUtils.findSchemaForChild(schema, childNode.getNodeType()); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/BaseDispatcherSerializer.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/BaseDispatcherSerializer.java index 053520de03..d356508da4 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/BaseDispatcherSerializer.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/BaseDispatcherSerializer.java @@ -10,7 +10,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializ import java.util.List; import java.util.Set; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; @@ -48,7 +48,7 @@ public abstract class BaseDispatcherSerializer * Schema should be retrieved from parent schema: schema. */ protected abstract DataSchemaNode getSchemaForChild(S schema, - DataContainerChild childNode); + DataContainerChild childNode); /** * @@ -70,7 +70,7 @@ public abstract class BaseDispatcherSerializer public Iterable serialize(S schema, N node) { List> choiceChildren = Lists.newArrayList(); - for (DataContainerChild choiceChild : node.getValue()) { + for (DataContainerChild choiceChild : node.getValue()) { Object childSchema; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/ChoiceNodeBaseSerializer.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/ChoiceNodeBaseSerializer.java index 9805b8eb23..fdff1aa1f2 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/ChoiceNodeBaseSerializer.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/ChoiceNodeBaseSerializer.java @@ -10,7 +10,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializ import java.util.HashSet; import java.util.Set; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; @@ -31,7 +31,7 @@ public abstract class ChoiceNodeBaseSerializer @Override protected final DataSchemaNode getSchemaForChild(final org.opendaylight.yangtools.yang.model.api.ChoiceNode schema, - final DataContainerChild childNode) { + final DataContainerChild childNode) { return SchemaUtils.findSchemaForChild(schema, childNode.getNodeType()); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/ContainerNodeBaseSerializer.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/ContainerNodeBaseSerializer.java index 73dff81924..d8a7322970 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/ContainerNodeBaseSerializer.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/ContainerNodeBaseSerializer.java @@ -9,7 +9,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializ import java.util.Set; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; @@ -29,7 +29,7 @@ public abstract class ContainerNodeBaseSerializer extends @Override protected final DataSchemaNode getSchemaForChild(ContainerSchemaNode schema, - DataContainerChild childNode) { + DataContainerChild childNode) { return SchemaUtils.findSchemaForChild(schema, childNode.getNodeType()); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/MapEntryNodeBaseSerializer.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/MapEntryNodeBaseSerializer.java index 21057b4b9d..827558e56e 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/MapEntryNodeBaseSerializer.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/MapEntryNodeBaseSerializer.java @@ -9,7 +9,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializ import java.util.Set; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; @@ -29,7 +29,7 @@ public abstract class MapEntryNodeBaseSerializer extends @Override protected final DataSchemaNode getSchemaForChild(ListSchemaNode schema, - DataContainerChild childNode) { + DataContainerChild childNode) { return SchemaUtils.findSchemaForChild(schema, childNode.getNodeType()); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/NodeSerializerDispatcher.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/NodeSerializerDispatcher.java index 9c1adfc623..d08a9fbf8d 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/NodeSerializerDispatcher.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/serializer/NodeSerializerDispatcher.java @@ -7,7 +7,7 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.serializer; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -35,7 +35,7 @@ import com.google.common.collect.Iterables; public interface NodeSerializerDispatcher { Iterable dispatchChildElement(Object childSchema, - DataContainerChild dataContainerChild); + DataContainerChild dataContainerChild); /** * Abstract implementation that implements the dispatch conditions. Only requires serializers to be provided. @@ -50,7 +50,7 @@ public interface NodeSerializerDispatcher { @Override public final Iterable dispatchChildElement(Object childSchema, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { if (dataContainerChild instanceof ContainerNode) { return onContainerNode(childSchema, dataContainerChild); } else if (dataContainerChild instanceof LeafNode) { @@ -70,14 +70,14 @@ public interface NodeSerializerDispatcher { } private Iterable onAugmentationSchema(Object childSchema, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { checkSchemaCompatibility(childSchema, AugmentationSchema.class, dataContainerChild); return factory.getAugmentationNodeSerializer().serialize((AugmentationSchema) childSchema, (AugmentationNode) dataContainerChild); } private Iterable onChoiceNode(Object childSchema, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { checkSchemaCompatibility(childSchema, org.opendaylight.yangtools.yang.model.api.ChoiceNode.class, dataContainerChild); return factory.getChoiceNodeSerializer() @@ -86,20 +86,20 @@ public interface NodeSerializerDispatcher { } private Iterable onListNode(Object childSchema, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { checkSchemaCompatibility(childSchema, ListSchemaNode.class, dataContainerChild); return factory.getMapNodeSerializer().serialize((ListSchemaNode) childSchema, (MapNode) dataContainerChild); } private Iterable onLeafListNode(Object childSchema, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { checkSchemaCompatibility(childSchema, LeafListSchemaNode.class, dataContainerChild); return factory.getLeafSetNodeSerializer().serialize((LeafListSchemaNode) childSchema, (LeafSetNode) dataContainerChild); } private Iterable onLeafNode(Object childSchema, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { checkSchemaCompatibility(childSchema, LeafSchemaNode.class, dataContainerChild); Iterable elements = factory.getLeafNodeSerializer().serialize((LeafSchemaNode) childSchema, (LeafNode) dataContainerChild); @@ -108,7 +108,7 @@ public interface NodeSerializerDispatcher { } private static void checkOnlyOneSerializedElement(Iterable elements, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { final int size = Iterables.size(elements); Preconditions.checkArgument(size == 1, "Unexpected count of elements for entry serialized from: %s, should be 1, was: %s", @@ -116,7 +116,7 @@ public interface NodeSerializerDispatcher { } private Iterable onContainerNode(Object childSchema, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { checkSchemaCompatibility(childSchema, ContainerSchemaNode.class, dataContainerChild); Iterable elements = factory.getContainerNodeSerializer().serialize((ContainerSchemaNode) childSchema, @@ -126,7 +126,7 @@ public interface NodeSerializerDispatcher { } private static void checkSchemaCompatibility(Object childSchema, Class containerSchemaNodeClass, - DataContainerChild dataContainerChild) { + DataContainerChild dataContainerChild) { Preconditions.checkArgument(containerSchemaNodeClass.isAssignableFrom(childSchema.getClass()), "Incompatible schema: %s with node: %s, expected: %s", childSchema, dataContainerChild, containerSchemaNodeClass); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractDataTreeCandidate.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractDataTreeCandidate.java index 3cd12c6197..b29a610c10 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractDataTreeCandidate.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractDataTreeCandidate.java @@ -8,20 +8,20 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate; import com.google.common.base.Preconditions; abstract class AbstractDataTreeCandidate implements DataTreeCandidate { - private final InstanceIdentifier rootPath; + private final YangInstanceIdentifier rootPath; - protected AbstractDataTreeCandidate(final InstanceIdentifier rootPath) { + protected AbstractDataTreeCandidate(final YangInstanceIdentifier rootPath) { this.rootPath = Preconditions.checkNotNull(rootPath); } @Override - public final InstanceIdentifier getRootPath() { + public final YangInstanceIdentifier getRootPath() { return rootPath; } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AlwaysFailOperation.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AlwaysFailOperation.java index 5d1152caf8..3c4ed612a5 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AlwaysFailOperation.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AlwaysFailOperation.java @@ -2,8 +2,8 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import com.google.common.base.Optional; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version; @@ -21,7 +21,7 @@ final class AlwaysFailOperation implements ModificationApplyOperation { } @Override - public void checkApplicable(final InstanceIdentifier path,final NodeModification modification, final Optional storeMetadata) { + public void checkApplicable(final YangInstanceIdentifier path,final NodeModification modification, final Optional storeMetadata) { throw new IllegalStateException("Schema Context is not available."); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/DataNodeContainerModificationStrategy.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/DataNodeContainerModificationStrategy.java index 30af8fce29..bfa3f28e6e 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/DataNodeContainerModificationStrategy.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/DataNodeContainerModificationStrategy.java @@ -13,8 +13,8 @@ import java.util.HashSet; import java.util.Set; import java.util.concurrent.ExecutionException; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTree.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTree.java index 668f7512c3..02e85a46a0 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTree.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTree.java @@ -10,7 +10,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; @@ -30,7 +30,7 @@ import com.google.common.base.Preconditions; */ final class InMemoryDataTree implements DataTree { private static final Logger LOG = LoggerFactory.getLogger(InMemoryDataTree.class); - private static final InstanceIdentifier PUBLIC_ROOT_PATH = InstanceIdentifier.builder().build(); + private static final YangInstanceIdentifier PUBLIC_ROOT_PATH = YangInstanceIdentifier.builder().build(); private final ReadWriteLock rwLock = new ReentrantReadWriteLock(true); private final LatestOperationHolder operationHolder = new LatestOperationHolder(); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeCandidate.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeCandidate.java index 1f6b0f01c2..833269aa9a 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeCandidate.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeCandidate.java @@ -5,8 +5,8 @@ import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +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; @@ -104,7 +104,7 @@ final class InMemoryDataTreeCandidate extends AbstractDataTreeCandidate { private final RootNode root; - InMemoryDataTreeCandidate(final InstanceIdentifier rootPath, final ModifiedNode modificationRoot, + InMemoryDataTreeCandidate(final YangInstanceIdentifier rootPath, final ModifiedNode modificationRoot, final TreeNode beforeRoot, final TreeNode afterRoot) { super(rootPath); this.root = new RootNode(modificationRoot, beforeRoot, afterRoot); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeFactory.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeFactory.java index 887a4bfafa..486c1c2cf5 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeFactory.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeFactory.java @@ -1,7 +1,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeFactory; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNodeFactory; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeModification.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeModification.java index 206c27372c..73d3ac36c0 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeModification.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeModification.java @@ -11,8 +11,8 @@ import java.util.Map.Entry; import javax.annotation.concurrent.GuardedBy; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +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.NormalizedNodeContainer; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; @@ -49,13 +49,13 @@ final class InMemoryDataTreeModification implements DataTreeModification { } @Override - public synchronized void write(final InstanceIdentifier path, final NormalizedNode value) { + public synchronized void write(final YangInstanceIdentifier path, final NormalizedNode value) { checkSealed(); resolveModificationFor(path).write(value); } @Override - public synchronized void merge(final InstanceIdentifier path, final NormalizedNode data) { + public synchronized void merge(final YangInstanceIdentifier path, final NormalizedNode data) { checkSealed(); mergeImpl(resolveModificationFor(path),data); } @@ -74,20 +74,20 @@ final class InMemoryDataTreeModification implements DataTreeModification { } @Override - public synchronized void delete(final InstanceIdentifier path) { + public synchronized void delete(final YangInstanceIdentifier path) { checkSealed(); resolveModificationFor(path).delete(); } @Override - public synchronized Optional> readNode(final InstanceIdentifier path) { + public synchronized Optional> readNode(final YangInstanceIdentifier path) { /* * Walk the tree from the top, looking for the first node between root and * the requested path which has been modified. If no such node exists, * we use the node itself. */ - final Entry entry = TreeNodeUtils.findClosestsOrFirstMatch(rootNode, path, ModifiedNode.IS_TERMINAL_PREDICATE); - final InstanceIdentifier key = entry.getKey(); + final Entry entry = TreeNodeUtils.findClosestsOrFirstMatch(rootNode, path, ModifiedNode.IS_TERMINAL_PREDICATE); + final YangInstanceIdentifier key = entry.getKey(); final ModifiedNode mod = entry.getValue(); final Optional result = resolveSnapshot(key, mod); @@ -99,7 +99,7 @@ final class InMemoryDataTreeModification implements DataTreeModification { } } - private Optional resolveSnapshot(final InstanceIdentifier path, + private Optional resolveSnapshot(final YangInstanceIdentifier path, final ModifiedNode modification) { final Optional> potentialSnapshot = modification.getSnapshotCache(); if(potentialSnapshot.isPresent()) { @@ -115,7 +115,7 @@ final class InMemoryDataTreeModification implements DataTreeModification { } } - private ModificationApplyOperation resolveModificationStrategy(final InstanceIdentifier path) { + private ModificationApplyOperation resolveModificationStrategy(final YangInstanceIdentifier path) { LOG.trace("Resolving modification apply strategy for {}", path); if(rootNode.getType() == ModificationType.UNMODIFIED) { strategyTree.upgradeIfPossible(); @@ -124,7 +124,7 @@ final class InMemoryDataTreeModification implements DataTreeModification { return TreeNodeUtils.findNodeChecked(strategyTree, path); } - private OperationWithModification resolveModificationFor(final InstanceIdentifier path) { + private OperationWithModification resolveModificationFor(final YangInstanceIdentifier path) { ModifiedNode modification = rootNode; // We ensure strategy is present. ModificationApplyOperation operation = resolveModificationStrategy(path); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeSnapshot.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeSnapshot.java index 9c0bd58435..0e61cd4031 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeSnapshot.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeSnapshot.java @@ -1,7 +1,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode; @@ -32,7 +32,7 @@ final class InMemoryDataTreeSnapshot implements DataTreeSnapshot { } @Override - public Optional> readNode(final InstanceIdentifier path) { + public Optional> readNode(final YangInstanceIdentifier path) { return NormalizedNodeUtils.findNode(rootNode.getData(), path); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModificationApplyOperation.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModificationApplyOperation.java index f2e13ce216..fd678e61c0 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModificationApplyOperation.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModificationApplyOperation.java @@ -8,8 +8,8 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import com.google.common.base.Optional; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version; @@ -88,5 +88,5 @@ interface ModificationApplyOperation extends StoreTreeNode current) throws DataValidationFailedException; + void checkApplicable(YangInstanceIdentifier path, NodeModification modification, Optional current) throws DataValidationFailedException; } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModifiedNode.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModifiedNode.java index a8739a6201..56353350af 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModifiedNode.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModifiedNode.java @@ -10,7 +10,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import com.google.common.base.Optional; import com.google.common.base.Predicate; import org.opendaylight.yangtools.concepts.Identifiable; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +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.ModificationType; import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NodeModification.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NodeModification.java index ad8dbd1ea2..409a713d49 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NodeModification.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NodeModification.java @@ -10,7 +10,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import com.google.common.base.Optional; import org.opendaylight.yangtools.concepts.Identifiable; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NoopDataTreeCandidate.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NoopDataTreeCandidate.java index a936b2c778..08e15d07a8 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NoopDataTreeCandidate.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NoopDataTreeCandidate.java @@ -9,8 +9,8 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +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; @@ -50,7 +50,7 @@ final class NoopDataTreeCandidate extends AbstractDataTreeCandidate { } }; - protected NoopDataTreeCandidate(final InstanceIdentifier rootPath, final ModifiedNode modificationRoot) { + protected NoopDataTreeCandidate(final YangInstanceIdentifier rootPath, final ModifiedNode modificationRoot) { super(rootPath); Preconditions.checkArgument(modificationRoot.getType() == ModificationType.UNMODIFIED); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NormalizedNodeContainerModificationStrategy.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NormalizedNodeContainerModificationStrategy.java index a59a8718a5..1a2d8f88e5 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NormalizedNodeContainerModificationStrategy.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/NormalizedNodeContainerModificationStrategy.java @@ -11,11 +11,11 @@ import static com.google.common.base.Preconditions.checkArgument; import java.util.Map; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -65,7 +65,7 @@ abstract class NormalizedNodeContainerModificationStrategy extends SchemaAwareAp } @Override - protected void checkWriteApplicable(final InstanceIdentifier path, final NodeModification modification, + protected void checkWriteApplicable(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { // FIXME: Implement proper write check for replacement of node container // prerequisite is to have transaction chain available for clients @@ -164,32 +164,32 @@ abstract class NormalizedNodeContainerModificationStrategy extends SchemaAwareAp } @Override - protected void checkSubtreeModificationApplicable(final InstanceIdentifier path, final NodeModification modification, + protected void checkSubtreeModificationApplicable(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { checkDoesNotExists(path, modification.getOriginal().isPresent() || current.isPresent(), "Node does not exist. Could not modify its children."); SchemaAwareApplyOperation.checkConflicting(path, current.isPresent(), "Node was deleted by other transaction."); checkChildPreconditions(path, modification, current); } - private static void checkDoesNotExists(final InstanceIdentifier path, final boolean condition, final String message) throws DataValidationFailedException { + private static void checkDoesNotExists(final YangInstanceIdentifier path, final boolean condition, final String message) throws DataValidationFailedException { if(!condition) { throw new ModifiedNodeDoesNotExistException(path,message); } } - private void checkChildPreconditions(final InstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { + private void checkChildPreconditions(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { final TreeNode currentMeta = current.get(); for (NodeModification childMod : modification.getChildren()) { final PathArgument childId = childMod.getIdentifier(); final Optional childMeta = currentMeta.getChild(childId); - InstanceIdentifier childPath = path.node(childId); + YangInstanceIdentifier childPath = path.node(childId); resolveChildOperation(childId).checkApplicable(childPath, childMod, childMeta); } } @Override - protected void checkMergeApplicable(final InstanceIdentifier path, final NodeModification modification, + protected void checkMergeApplicable(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { if(current.isPresent()) { checkChildPreconditions(path, modification,current); diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/OperationWithModification.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/OperationWithModification.java index 2cd757d042..511fc322cb 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/OperationWithModification.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/OperationWithModification.java @@ -9,7 +9,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import com.google.common.base.Optional; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +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.spi.TreeNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/RootModificationApplyOperation.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/RootModificationApplyOperation.java index fd3b73473a..3007324bed 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/RootModificationApplyOperation.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/RootModificationApplyOperation.java @@ -7,8 +7,8 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version; @@ -23,7 +23,7 @@ public abstract class RootModificationApplyOperation implements ModificationAppl } @Override - public final void checkApplicable(final InstanceIdentifier path, final NodeModification modification, final Optional current) + public final void checkApplicable(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { getDelegate().checkApplicable(path, modification, current); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/SchemaAwareApplyOperation.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/SchemaAwareApplyOperation.java index d71ea7930c..915f2fbf87 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/SchemaAwareApplyOperation.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/SchemaAwareApplyOperation.java @@ -13,10 +13,10 @@ import com.google.common.base.Preconditions; import java.util.List; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +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.ConflictingModificationAppliedException; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException; @@ -75,7 +75,7 @@ abstract class SchemaAwareApplyOperation implements ModificationApplyOperation { return null; } - public static boolean checkConflicting(final InstanceIdentifier path, final boolean condition, final String message) throws ConflictingModificationAppliedException { + public static boolean checkConflicting(final YangInstanceIdentifier path, final boolean condition, final String message) throws ConflictingModificationAppliedException { if(!condition) { throw new ConflictingModificationAppliedException(path, message); } @@ -102,7 +102,7 @@ abstract class SchemaAwareApplyOperation implements ModificationApplyOperation { } } - private static final void checkNotConflicting(final InstanceIdentifier path, final TreeNode original, final TreeNode current) throws ConflictingModificationAppliedException { + private static final void checkNotConflicting(final YangInstanceIdentifier path, final TreeNode original, final TreeNode current) throws ConflictingModificationAppliedException { checkConflicting(path, original.getVersion().equals(current.getVersion()), "Node was replaced by other transaction."); checkConflicting(path, original.getSubtreeVersion().equals(current.getSubtreeVersion()), @@ -123,7 +123,7 @@ abstract class SchemaAwareApplyOperation implements ModificationApplyOperation { } @Override - public final void checkApplicable(final InstanceIdentifier path,final NodeModification modification, final Optional current) throws DataValidationFailedException { + public final void checkApplicable(final YangInstanceIdentifier path,final NodeModification modification, final Optional current) throws DataValidationFailedException { switch (modification.getType()) { case DELETE: checkDeleteApplicable(modification, current); @@ -144,7 +144,7 @@ abstract class SchemaAwareApplyOperation implements ModificationApplyOperation { } - protected void checkMergeApplicable(final InstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { + protected void checkMergeApplicable(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { Optional original = modification.getOriginal(); if (original.isPresent() && current.isPresent()) { /* @@ -159,7 +159,7 @@ abstract class SchemaAwareApplyOperation implements ModificationApplyOperation { } } - protected void checkWriteApplicable(final InstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { + protected void checkWriteApplicable(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException { Optional original = modification.getOriginal(); if (original.isPresent() && current.isPresent()) { checkNotConflicting(path, original.get(), current.get()); @@ -220,7 +220,7 @@ abstract class SchemaAwareApplyOperation implements ModificationApplyOperation { * @throws ConflictingModificationAppliedException If subtree was changed in conflicting way * @throws IncorrectDataStructureException If subtree modification is not applicable (e.g. leaf node). */ - protected abstract void checkSubtreeModificationApplicable(InstanceIdentifier path, final NodeModification modification, + protected abstract void checkSubtreeModificationApplicable(YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws DataValidationFailedException; protected abstract void verifyWrittenStructure(NormalizedNode writtenValue); @@ -270,7 +270,7 @@ abstract class SchemaAwareApplyOperation implements ModificationApplyOperation { } @Override - protected void checkSubtreeModificationApplicable(final InstanceIdentifier path, final NodeModification modification, + protected void checkSubtreeModificationApplicable(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws IncorrectDataStructureException { throw new IncorrectDataStructureException(path, "Subtree modification is not allowed."); } diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/StoreUtils.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/StoreUtils.java index bca16841d9..66dd68fd05 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/StoreUtils.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/StoreUtils.java @@ -7,9 +7,9 @@ */ package org.opendaylight.yangtools.yang.data.impl.schema.tree; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +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.NormalizedNodeContainer; diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TreeNodeUtils.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TreeNodeUtils.java index fe5f4db0bb..f51c0c63fd 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TreeNodeUtils.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TreeNodeUtils.java @@ -17,8 +17,8 @@ import java.util.AbstractMap.SimpleEntry; import java.util.Iterator; import java.util.Map; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNode; /** @@ -36,7 +36,7 @@ public final class TreeNodeUtils { * @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) { + public static > Optional findNode(final T tree, final YangInstanceIdentifier path) { Optional current = Optional. of(tree); Iterator pathIter = path.getPathArguments().iterator(); while (current.isPresent() && pathIter.hasNext()) { @@ -45,7 +45,7 @@ public final class TreeNodeUtils { return current; } - public static > T findNodeChecked(final T tree, final InstanceIdentifier path) { + public static > T findNodeChecked(final T tree, final YangInstanceIdentifier path) { T current = tree; int i = 1; @@ -69,11 +69,11 @@ public final class TreeNodeUtils { * @return Map.Entry Entry with key which is path to closest parent and value is parent node. * */ - public static > Map.Entry findClosest(final T tree, final InstanceIdentifier path) { + public static > Map.Entry findClosest(final T tree, final YangInstanceIdentifier path) { return findClosestsOrFirstMatch(tree, path, Predicates.alwaysFalse()); } - public static > Map.Entry findClosestsOrFirstMatch(final T tree, final InstanceIdentifier path, final Predicate predicate) { + public static > Map.Entry findClosestsOrFirstMatch(final T tree, final YangInstanceIdentifier path, final Predicate predicate) { Optional parent = Optional.of(tree); Optional current = Optional. of(tree); @@ -85,8 +85,8 @@ public final class TreeNodeUtils { nesting++; } if(current.isPresent()) { - final InstanceIdentifier currentPath = InstanceIdentifier.create(path.getPath().subList(0, nesting)); - return new SimpleEntry(currentPath,current.get()); + final YangInstanceIdentifier currentPath = YangInstanceIdentifier.create(path.getPath().subList(0, nesting)); + return new SimpleEntry(currentPath,current.get()); } /* @@ -96,9 +96,9 @@ public final class TreeNodeUtils { * present. At any rate we check state just to be on the safe side. */ Preconditions.checkState(nesting > 0); - final InstanceIdentifier parentPath = InstanceIdentifier.create(path.getPath().subList(0, nesting - 1)); + final YangInstanceIdentifier parentPath = YangInstanceIdentifier.create(path.getPath().subList(0, nesting - 1)); - return new SimpleEntry(parentPath,parent.get()); + return new SimpleEntry(parentPath,parent.get()); } public static > Optional getChild(final Optional parent,final PathArgument child) { diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ValueNodeModificationStrategy.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ValueNodeModificationStrategy.java index a352aecedd..6979a64f71 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ValueNodeModificationStrategy.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ValueNodeModificationStrategy.java @@ -8,8 +8,8 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import com.google.common.base.Optional; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -66,7 +66,7 @@ abstract class ValueNodeModificationStrategy extends S } @Override - protected void checkSubtreeModificationApplicable(final InstanceIdentifier path, final NodeModification modification, + protected void checkSubtreeModificationApplicable(final YangInstanceIdentifier path, final NodeModification modification, final Optional current) throws IncorrectDataStructureException { throw new IncorrectDataStructureException(path, "Subtree modification is not allowed."); } diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtilsTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtilsTest.java index 97469fe000..8ee05ff447 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtilsTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtilsTest.java @@ -24,8 +24,8 @@ import org.custommonkey.xmlunit.XMLUnit; import org.junit.Before; import org.junit.Test; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.SimpleNode; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.RpcDefinition; @@ -77,7 +77,7 @@ public class XmlDocumentUtilsTest { final CompositeNode node = inputXmlToCompositeNode(input); final SimpleNode refParsed = node.getSimpleNodesByName("ref").iterator().next(); - Assert.assertEquals(InstanceIdentifier.class, refParsed.getValue().getClass()); + Assert.assertEquals(YangInstanceIdentifier.class, refParsed.getValue().getClass()); final Document serializedDocument = inputCompositeNodeToXml(node); XMLUnit.compareXML(inputDocument, serializedDocument); diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/NormalizedDataBuilderTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/NormalizedDataBuilderTest.java index d15c6339c7..c9fbe58e5e 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/NormalizedDataBuilderTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/NormalizedDataBuilderTest.java @@ -22,7 +22,7 @@ import java.util.Set; import org.junit.Before; import org.junit.Test; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; @@ -77,7 +77,7 @@ public class NormalizedDataBuilderTest { @Test public void testSchemaUnaware() throws Exception { // Container - DataContainerNodeBuilder builder = Builders + DataContainerNodeBuilder builder = Builders .containerBuilder().withNodeIdentifier(getNodeIdentifier("container")); // leaf @@ -104,7 +104,7 @@ public class NormalizedDataBuilderTest { .withValue(1).build()) .withChild(Builders.containerBuilder().withNodeIdentifier(getNodeIdentifier("containerInList")).build()) .withNodeIdentifier( - new InstanceIdentifier.NodeIdentifierWithPredicates(getNodeIdentifier("list").getNodeType(), + new YangInstanceIdentifier.NodeIdentifierWithPredicates(getNodeIdentifier("list").getNodeType(), Collections.singletonMap(getNodeIdentifier("uint32InList").getNodeType(), (Object) 1))) .build(); @@ -115,7 +115,7 @@ public class NormalizedDataBuilderTest { AugmentationNode augmentation = Builders .augmentationBuilder() .withNodeIdentifier( - new InstanceIdentifier.AugmentationIdentifier(Sets.newHashSet(getQName("augmentUint32")))) + new YangInstanceIdentifier.AugmentationIdentifier(Sets.newHashSet(getQName("augmentUint32")))) .withChild( Builders. leafBuilder().withNodeIdentifier(getNodeIdentifier("augmentUint32")) .withValue(11).build()).build(); @@ -130,7 +130,7 @@ public class NormalizedDataBuilderTest { @Test public void testSchemaAware() throws Exception { - DataContainerNodeBuilder builder = Builders + DataContainerNodeBuilder builder = Builders .containerBuilder(containerNode); LeafSchemaNode schemaNode = (LeafSchemaNode) getSchemaNode(schema, "test", "uint32"); @@ -195,8 +195,8 @@ public class NormalizedDataBuilderTest { throw new IllegalStateException("Unable to find child augmentation in " + containerNode); } - private InstanceIdentifier.NodeWithValue getNodeWithValueIdentifier(final String localName, final Object value) { - return new InstanceIdentifier.NodeWithValue(getQName(localName), value); + private YangInstanceIdentifier.NodeWithValue getNodeWithValueIdentifier(final String localName, final Object value) { + return new YangInstanceIdentifier.NodeWithValue(getQName(localName), value); } private QName getQName(final String localName) { @@ -204,8 +204,8 @@ public class NormalizedDataBuilderTest { return new QName(URI.create(namespace), localName); } - private InstanceIdentifier.NodeIdentifier getNodeIdentifier(final String localName) { - return new InstanceIdentifier.NodeIdentifier(getQName(localName)); + private YangInstanceIdentifier.NodeIdentifier getNodeIdentifier(final String localName) { + return new YangInstanceIdentifier.NodeIdentifier(getQName(localName)); } public static DataSchemaNode getSchemaNode(final SchemaContext context, final String moduleName, final String childNodeName) { diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/test/NormalizedNodeUtilsTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/test/NormalizedNodeUtilsTest.java index ebf2c0bf58..0b21ea01df 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/test/NormalizedNodeUtilsTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/test/NormalizedNodeUtilsTest.java @@ -8,8 +8,8 @@ import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.ma import org.junit.Test; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeUtils; import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder; @@ -56,12 +56,12 @@ public class NormalizedNodeUtilsTest { private static final String ONE = "one"; private static final String TWO = "two"; - private static final InstanceIdentifier LIST_A_FOO_PATH = InstanceIdentifier.builder() + private static final YangInstanceIdentifier LIST_A_FOO_PATH = YangInstanceIdentifier.builder() //.node(ROOT_QNAME) .node(LIST_A_QNAME) .nodeWithKey(LIST_A_QNAME, LEAF_A_QNAME, FOO) .build(); - private static final InstanceIdentifier LIST_B_TWO_PATH = InstanceIdentifier.builder() + private static final YangInstanceIdentifier LIST_B_TWO_PATH = YangInstanceIdentifier.builder() //.node(ROOT_QNAME) .node(LIST_A_QNAME) .nodeWithKey(LIST_A_QNAME, LEAF_A_QNAME, BAR) diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/dom/serializer/NormalizedNodeXmlTranslationTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/dom/serializer/NormalizedNodeXmlTranslationTest.java index cbd7da381b..47bc9ea543 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/dom/serializer/NormalizedNodeXmlTranslationTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/dom/serializer/NormalizedNodeXmlTranslationTest.java @@ -45,7 +45,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; @@ -98,7 +98,7 @@ public class NormalizedNodeXmlTranslationTest { } private static ContainerNode withAttributes() { - DataContainerNodeBuilder b = Builders.containerBuilder(); + DataContainerNodeBuilder b = Builders.containerBuilder(); b.withNodeIdentifier(getNodeIdentifier("container")); CollectionNodeBuilder listBuilder = Builders.mapBuilder().withNodeIdentifier( @@ -107,11 +107,11 @@ public class NormalizedNodeXmlTranslationTest { Map predicates = Maps.newHashMap(); predicates.put(getNodeIdentifier("uint32InList").getNodeType(), 3L); - DataContainerNodeBuilder list1Builder = Builders + DataContainerNodeBuilder list1Builder = Builders .mapEntryBuilder().withNodeIdentifier( - new InstanceIdentifier.NodeIdentifierWithPredicates(getNodeIdentifier("list").getNodeType(), + new YangInstanceIdentifier.NodeIdentifierWithPredicates(getNodeIdentifier("list").getNodeType(), predicates)); - NormalizedNodeBuilder> uint32InListBuilder + NormalizedNodeBuilder> uint32InListBuilder = Builders.leafBuilder().withNodeIdentifier(getNodeIdentifier("uint32InList")); list1Builder.withChild(uint32InListBuilder.withValue(3L).build()); @@ -119,7 +119,7 @@ public class NormalizedNodeXmlTranslationTest { listBuilder.withChild(list1Builder.build()); b.withChild(listBuilder.build()); - NormalizedNodeBuilder> booleanBuilder + NormalizedNodeBuilder> booleanBuilder = Builders.leafBuilder().withNodeIdentifier(getNodeIdentifier("boolean")); booleanBuilder.withValue(false); b.withChild(booleanBuilder.build()); @@ -127,8 +127,8 @@ public class NormalizedNodeXmlTranslationTest { ListNodeBuilder> leafListBuilder = Builders.leafSetBuilder().withNodeIdentifier(getNodeIdentifier("leafList")); - NormalizedNodeBuilder> leafList1Builder - = Builders.leafSetEntryBuilder().withNodeIdentifier(new InstanceIdentifier.NodeWithValue(getNodeIdentifier("leafList").getNodeType(), "a")); + NormalizedNodeBuilder> leafList1Builder + = Builders.leafSetEntryBuilder().withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue(getNodeIdentifier("leafList").getNodeType(), "a")); leafList1Builder.withValue("a"); @@ -140,7 +140,7 @@ public class NormalizedNodeXmlTranslationTest { private static ContainerNode augmentChoiceHell() { - DataContainerNodeBuilder b = Builders.containerBuilder(); + DataContainerNodeBuilder b = Builders.containerBuilder(); b.withNodeIdentifier(getNodeIdentifier("container")); b.withChild( @@ -185,18 +185,18 @@ public class NormalizedNodeXmlTranslationTest { return b.build(); } - private static InstanceIdentifier.NodeIdentifier getNodeIdentifier(final String localName) { - return new InstanceIdentifier.NodeIdentifier(QName.create(URI.create(NAMESPACE), revision, localName)); + private static YangInstanceIdentifier.NodeIdentifier getNodeIdentifier(final String localName) { + return new YangInstanceIdentifier.NodeIdentifier(QName.create(URI.create(NAMESPACE), revision, localName)); } - public static InstanceIdentifier.AugmentationIdentifier getAugmentIdentifier(final String... childNames) { + public static YangInstanceIdentifier.AugmentationIdentifier getAugmentIdentifier(final String... childNames) { Set qn = Sets.newHashSet(); for (String childName : childNames) { qn.add(getNodeIdentifier(childName).getNodeType()); } - return new InstanceIdentifier.AugmentationIdentifier(qn); + return new YangInstanceIdentifier.AugmentationIdentifier(qn); } public NormalizedNodeXmlTranslationTest(final String yangPath, final String xmlPath, final ContainerNode expectedNode) { diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModificationMetadataTreeTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModificationMetadataTreeTest.java index 003c20fe7c..a85acfd1e4 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModificationMetadataTreeTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModificationMetadataTreeTest.java @@ -18,8 +18,8 @@ import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.ma import org.junit.Before; import org.junit.Test; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; @@ -73,20 +73,20 @@ public class ModificationMetadataTreeTest { private static final String TWO_ONE_NAME = "one"; private static final String TWO_TWO_NAME = "two"; - private static final InstanceIdentifier OUTER_LIST_1_PATH = InstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) + private static final YangInstanceIdentifier OUTER_LIST_1_PATH = YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID) // .build(); - private static final InstanceIdentifier OUTER_LIST_2_PATH = InstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) + private static final YangInstanceIdentifier OUTER_LIST_2_PATH = YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID) // .build(); - private static final InstanceIdentifier TWO_TWO_PATH = InstanceIdentifier.builder(OUTER_LIST_2_PATH) + private static final YangInstanceIdentifier TWO_TWO_PATH = YangInstanceIdentifier.builder(OUTER_LIST_2_PATH) .node(TestModel.INNER_LIST_QNAME) // .nodeWithKey(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_TWO_NAME) // .build(); - private static final InstanceIdentifier TWO_TWO_VALUE_PATH = InstanceIdentifier.builder(TWO_TWO_PATH) + private static final YangInstanceIdentifier TWO_TWO_VALUE_PATH = YangInstanceIdentifier.builder(TWO_TWO_PATH) .node(TestModel.VALUE_QNAME) // .build(); diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TestModel.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TestModel.java index 5c81b6cba9..20aace6a39 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TestModel.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TestModel.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.impl.schema.tree; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl; @@ -29,8 +29,8 @@ public class TestModel { public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value"); private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang"; - public static final InstanceIdentifier TEST_PATH = InstanceIdentifier.of(TEST_QNAME); - public static final InstanceIdentifier OUTER_LIST_PATH = InstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build(); + public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier.of(TEST_QNAME); + public static final YangInstanceIdentifier OUTER_LIST_PATH = YangInstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build(); public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two"); public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three"); diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TreeNodeUtilsTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TreeNodeUtilsTest.java index 9098e325ac..cba1f506b2 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TreeNodeUtilsTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/TreeNodeUtilsTest.java @@ -4,7 +4,7 @@ import com.google.common.base.Optional; import junit.framework.Assert; import org.junit.Before; import org.junit.Test; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -30,15 +30,15 @@ public class TreeNodeUtilsTest { private static final String TWO_ONE_NAME = "one"; private static final String TWO_TWO_NAME = "two"; - private static final InstanceIdentifier OUTER_LIST_1_PATH = InstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) + private static final YangInstanceIdentifier OUTER_LIST_1_PATH = YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID) // .build(); - private static final InstanceIdentifier OUTER_LIST_2_PATH = InstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) + private static final YangInstanceIdentifier OUTER_LIST_2_PATH = YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID) // .build(); - private static final InstanceIdentifier TWO_TWO_PATH = InstanceIdentifier.builder(OUTER_LIST_2_PATH) + private static final YangInstanceIdentifier TWO_TWO_PATH = YangInstanceIdentifier.builder(OUTER_LIST_2_PATH) .node(TestModel.INNER_LIST_QNAME) // .nodeWithKey(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, TWO_TWO_NAME) // .build(); @@ -63,7 +63,7 @@ public class TreeNodeUtilsTest { public NormalizedNode createDocumentOne() { return ImmutableContainerNodeBuilder .create() - .withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(schemaContext.getQName())) + .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schemaContext.getQName())) .withChild(createTestContainer()).build(); } @@ -71,7 +71,7 @@ public class TreeNodeUtilsTest { private ContainerNode createTestContainer() { return ImmutableContainerNodeBuilder .create() - .withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME)) + .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME)) .withChild( mapNodeBuilder(TestModel.OUTER_LIST_QNAME) .withChild(mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID)) @@ -99,7 +99,7 @@ public class TreeNodeUtilsTest { InMemoryDataTreeSnapshot inMemoryDataTreeSnapshot = new InMemoryDataTreeSnapshot(schemaContext, TreeNodeFactory.createTreeNode(createDocumentOne(), Version.initial()), rootOper); TreeNode rootNode = inMemoryDataTreeSnapshot.getRootNode(); - final InstanceIdentifier outerList1InvalidPath = InstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) + final YangInstanceIdentifier outerList1InvalidPath = YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 3) // .build(); Optional node = TreeNodeUtils.findNode(rootNode, outerList1InvalidPath); @@ -125,7 +125,7 @@ public class TreeNodeUtilsTest { InMemoryDataTreeSnapshot inMemoryDataTreeSnapshot = new InMemoryDataTreeSnapshot(schemaContext, TreeNodeFactory.createTreeNode(createDocumentOne(), Version.initial()), rootOper); TreeNode rootNode = inMemoryDataTreeSnapshot.getRootNode(); - final InstanceIdentifier outerList1InvalidPath = InstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) + final YangInstanceIdentifier outerList1InvalidPath = YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 3) // .build(); try { @@ -143,7 +143,7 @@ public class TreeNodeUtilsTest { TreeNode rootNode = inMemoryDataTreeSnapshot.getRootNode(); Optional expectedNode = TreeNodeUtils.findNode(rootNode, TWO_TWO_PATH); assertPresentAndType(expectedNode, TreeNode.class); - Map.Entry actualNode = TreeNodeUtils.findClosest(rootNode, TWO_TWO_PATH); + Map.Entry actualNode = TreeNodeUtils.findClosest(rootNode, TWO_TWO_PATH); Assert.assertEquals("Expected node and actual node are not the same", expectedNode.get(), actualNode.getValue()); } @@ -152,16 +152,16 @@ public class TreeNodeUtilsTest { InMemoryDataTreeSnapshot inMemoryDataTreeSnapshot = new InMemoryDataTreeSnapshot(schemaContext, TreeNodeFactory.createTreeNode(createDocumentOne(), Version.initial()), rootOper); TreeNode rootNode = inMemoryDataTreeSnapshot.getRootNode(); - final InstanceIdentifier outerListInnerListPath = InstanceIdentifier.builder(OUTER_LIST_2_PATH) + final YangInstanceIdentifier outerListInnerListPath = YangInstanceIdentifier.builder(OUTER_LIST_2_PATH) .node(TestModel.INNER_LIST_QNAME) .build(); - final InstanceIdentifier twoTwoInvalidPath = InstanceIdentifier.builder(OUTER_LIST_2_PATH) + final YangInstanceIdentifier twoTwoInvalidPath = YangInstanceIdentifier.builder(OUTER_LIST_2_PATH) .node(TestModel.INNER_LIST_QNAME) // .nodeWithKey(TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, "three") // .build(); Optional expectedNode = TreeNodeUtils.findNode(rootNode, outerListInnerListPath); assertPresentAndType(expectedNode, TreeNode.class); - Map.Entry actualNode = TreeNodeUtils.findClosest(rootNode, twoTwoInvalidPath); + Map.Entry actualNode = TreeNodeUtils.findClosest(rootNode, twoTwoInvalidPath); Assert.assertEquals("Expected node and actual node are not the same", expectedNode.get(), actualNode.getValue()); } diff --git a/yang/yang-data-json/src/test/java/org/opendaylight/yangtools/yang/data/json/schema/TestUtils.java b/yang/yang-data-json/src/test/java/org/opendaylight/yangtools/yang/data/json/schema/TestUtils.java index 1528506e78..f6eb9a3cc5 100644 --- a/yang/yang-data-json/src/test/java/org/opendaylight/yangtools/yang/data/json/schema/TestUtils.java +++ b/yang/yang-data-json/src/test/java/org/opendaylight/yangtools/yang/data/json/schema/TestUtils.java @@ -29,9 +29,9 @@ import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.MutableCompositeNode; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -269,32 +269,32 @@ public class TestUtils { return build; } - private static InstanceIdentifier.NodeIdentifier getNodeIdentifier(final String localName) { + private static YangInstanceIdentifier.NodeIdentifier getNodeIdentifier(final String localName) { return getNodeIdentifier(MODULE_BASE, localName); } - private static InstanceIdentifier.NodeIdentifier getNodeIdentifier(final QNameModule module, final String localName) { - return new InstanceIdentifier.NodeIdentifier(QName.create(module, localName)); + private static YangInstanceIdentifier.NodeIdentifier getNodeIdentifier(final QNameModule module, final String localName) { + return new YangInstanceIdentifier.NodeIdentifier(QName.create(module, localName)); } - private static InstanceIdentifier.NodeWithValue getNodeIdentifier(final String localName, final Object value) { - return new InstanceIdentifier.NodeWithValue(QName.create(MODULE_BASE, localName), + private static YangInstanceIdentifier.NodeWithValue getNodeIdentifier(final String localName, final Object value) { + return new YangInstanceIdentifier.NodeWithValue(QName.create(MODULE_BASE, localName), value); } - private static InstanceIdentifier.NodeIdentifierWithPredicates getNodeIdentifierPredicate(final String localName, + private static YangInstanceIdentifier.NodeIdentifierWithPredicates getNodeIdentifierPredicate(final String localName, final Map keys) { Map predicate = new HashMap<>(); for (String key : keys.keySet()) { predicate.put(QName.create(MODULE_BASE, key), keys.get(key)); } - return new InstanceIdentifier.NodeIdentifierWithPredicates(QName.create(MODULE_BASE, localName), predicate); + return new YangInstanceIdentifier.NodeIdentifierWithPredicates(QName.create(MODULE_BASE, localName), predicate); } - private static InstanceIdentifier.AugmentationIdentifier getAugmentationIdentifier(final String localName, + private static YangInstanceIdentifier.AugmentationIdentifier getAugmentationIdentifier(final String localName, final String namespace, final Date revision, final Set children) { - return new InstanceIdentifier.AugmentationIdentifier(children); + return new YangInstanceIdentifier.AugmentationIdentifier(children); } } diff --git a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/AbstractContainerNodeModification.java b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/AbstractContainerNodeModification.java index 1f3a7d3072..ddfc69e6e7 100644 --- a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/AbstractContainerNodeModification.java +++ b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/AbstractContainerNodeModification.java @@ -11,7 +11,7 @@ import java.util.List; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -88,7 +88,7 @@ abstract class AbstractContainerNodeModification toProcess = getChildrenToProcess(schema, actual, modification); + Set toProcess = getChildrenToProcess(schema, actual, modification); List> merged = modifyContainerChildNodes(schema, operationStack, actual.get(), modification.get(), toProcess); @@ -96,10 +96,10 @@ abstract class AbstractContainerNodeModification> modifyContainerChildNodes(S schema, OperationStack operationStack, - N actual, N modification, Set toProcess) throws DataModificationException { + N actual, N modification, Set toProcess) throws DataModificationException { List> result = Lists.newArrayList(); - for (InstanceIdentifier.PathArgument childToProcessId : toProcess) { + for (YangInstanceIdentifier.PathArgument childToProcessId : toProcess) { Object schemaOfChildToProcess = findSchema(schema, childToProcessId); Optional> modifiedValues = modifyContainerNode(operationStack, actual, @@ -114,7 +114,7 @@ abstract class AbstractContainerNodeModification> modifyContainerNode(OperationStack operationStack, N actual, - N modification, InstanceIdentifier.PathArgument childToProcess, Object schemaChild) + N modification, YangInstanceIdentifier.PathArgument childToProcess, Object schemaChild) throws DataModificationException { Optional> storedChildren = actual.getChild(childToProcess); @@ -123,9 +123,9 @@ abstract class AbstractContainerNodeModification build(S schema, List> result) { DataContainerNodeBuilder b = getBuilder(schema); @@ -151,19 +151,19 @@ abstract class AbstractContainerNodeModification getBuilder(S schema); - protected Set getChildrenToProcess(S schema, Optional actual, + protected Set getChildrenToProcess(S schema, Optional actual, Optional modification) throws DataModificationException { - Set qNames = Sets.newLinkedHashSet(); + Set qNames = Sets.newLinkedHashSet(); qNames.addAll(getChildQNames(actual)); qNames.addAll(getChildQNames(modification)); return qNames; } - private Set getChildQNames(Optional actual) { - Set qNames = Sets.newLinkedHashSet(); + private Set getChildQNames(Optional actual) { + Set qNames = Sets.newLinkedHashSet(); - for (DataContainerChild child : actual.get().getValue()) { + for (DataContainerChild child : actual.get().getValue()) { qNames.add(child.getIdentifier()); } diff --git a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/AugmentationNodeModification.java b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/AugmentationNodeModification.java index 9d3168f247..b6f361138b 100644 --- a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/AugmentationNodeModification.java +++ b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/AugmentationNodeModification.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.operations; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -29,7 +29,7 @@ final class AugmentationNodeModification extends AbstractContainerNodeModificati } @Override - protected Object findSchemaForAugment(AugmentationSchema schema, InstanceIdentifier.AugmentationIdentifier childToProcessId) { + protected Object findSchemaForAugment(AugmentationSchema schema, YangInstanceIdentifier.AugmentationIdentifier childToProcessId) { throw new UnsupportedOperationException("Augmentation cannot be augmented directly, " + schema); } diff --git a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ChoiceNodeModification.java b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ChoiceNodeModification.java index 723d654227..e281ea7339 100644 --- a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ChoiceNodeModification.java +++ b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ChoiceNodeModification.java @@ -10,7 +10,7 @@ package org.opendaylight.yangtools.yang.data.operations; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; @@ -36,11 +36,11 @@ final class ChoiceNodeModification extends } @Override - protected Set getChildrenToProcess(ChoiceNode schema, + protected Set getChildrenToProcess(ChoiceNode schema, Optional actual, Optional modification) throws DataModificationException { - Set childrenToProcess = super.getChildrenToProcess(schema, actual, + Set childrenToProcess = super.getChildrenToProcess(schema, actual, modification); if (modification.isPresent() == false) { @@ -49,7 +49,7 @@ final class ChoiceNodeModification extends // Detect case node from modification ChoiceCaseNode detectedCase = null; - for (DataContainerChild child : modification.get().getValue()) { + for (DataContainerChild child : modification.get().getValue()) { Optional detectedCaseForChild = SchemaUtils.detectCase(schema, child); if(detectedCaseForChild.isPresent() == false) { @@ -69,12 +69,12 @@ final class ChoiceNodeModification extends // Filter out child nodes that do not belong to detected case = // Nodes from other cases present in actual - Set childrenToProcessFiltered = Sets.newLinkedHashSet(); - for (InstanceIdentifier.PathArgument childToProcess : childrenToProcess) { + Set childrenToProcessFiltered = Sets.newLinkedHashSet(); + for (YangInstanceIdentifier.PathArgument childToProcess : childrenToProcess) { // child from other cases, skip if (childToProcess instanceof AugmentationNode && SchemaUtils.belongsToCaseAugment(detectedCase, - (InstanceIdentifier.AugmentationIdentifier) childToProcess) == false) { + (YangInstanceIdentifier.AugmentationIdentifier) childToProcess) == false) { continue; } else if (belongsToCase(detectedCase, childToProcess) == false) { continue; @@ -86,12 +86,12 @@ final class ChoiceNodeModification extends return childrenToProcessFiltered; } - private boolean belongsToCase(ChoiceCaseNode detectedCase, InstanceIdentifier.PathArgument childToProcess) { + private boolean belongsToCase(ChoiceCaseNode detectedCase, YangInstanceIdentifier.PathArgument childToProcess) { return detectedCase.getDataChildByName(childToProcess.getNodeType()) != null; } @Override - protected Object findSchemaForAugment(ChoiceNode schema, InstanceIdentifier.AugmentationIdentifier childToProcessId) { + protected Object findSchemaForAugment(ChoiceNode schema, YangInstanceIdentifier.AugmentationIdentifier childToProcessId) { return SchemaUtils.findSchemaForAugment(schema, childToProcessId.getPossibleChildNames()); } diff --git a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ContainerNodeModification.java b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ContainerNodeModification.java index a9b01512ff..17b1f6a5cb 100644 --- a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ContainerNodeModification.java +++ b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/ContainerNodeModification.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.operations; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -31,7 +31,7 @@ final class ContainerNodeModification extends AbstractContainerNodeModification< @Override protected Object findSchemaForAugment(ContainerSchemaNode schema, - InstanceIdentifier.AugmentationIdentifier childToProcessId) { + YangInstanceIdentifier.AugmentationIdentifier childToProcessId) { return SchemaUtils.findSchemaForAugment(schema, childToProcessId.getPossibleChildNames()); } diff --git a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/MapEntryNodeModification.java b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/MapEntryNodeModification.java index 9fe6b1d0ac..f7c0ea09ab 100644 --- a/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/MapEntryNodeModification.java +++ b/yang/yang-data-operations/src/main/java/org/opendaylight/yangtools/yang/data/operations/MapEntryNodeModification.java @@ -8,7 +8,7 @@ package org.opendaylight.yangtools.yang.data.operations; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder; @@ -28,7 +28,7 @@ final class MapEntryNodeModification extends AbstractContainerNodeModification resultNodes = Maps.newLinkedHashMap(); + Map resultNodes = Maps.newLinkedHashMap(); if(actual.isPresent()) resultNodes.putAll(mapEntries(actual.get())); @@ -41,7 +41,7 @@ public class MapNodeModification implements Modification build(ListSchemaNode schema, Map resultNodes) { + private Optional build(ListSchemaNode schema, Map resultNodes) { if(resultNodes.isEmpty()) return Optional.absent(); @@ -96,8 +96,8 @@ public class MapNodeModification implements Modification mapEntries(MapNode mapNode) { - Map mapped = Maps.newLinkedHashMap(); + private Map mapEntries(MapNode mapNode) { + Map mapped = Maps.newLinkedHashMap(); for (MapEntryNode mapEntryNode : mapNode.getValue()) { mapped.put(mapEntryNode.getIdentifier(), mapEntryNode); -- 2.36.6