Remove binding2/prototype 32/76632/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 4 Oct 2018 08:18:17 +0000 (10:18 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 4 Oct 2018 08:24:03 +0000 (10:24 +0200)
This code is not plugged into build, hence it is pure clutter.

Change-Id: I69139ceef2a26136a91e9c8cbc0ad95559eefc8c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
98 files changed:
binding2/prototype/pom.xml [deleted file]
binding2/prototype/readme.adoc [deleted file]
binding2/prototype/src/main/yang/mainYangTest.yang [deleted file]
binding2/prototype/src/main/yang/mainYangTestImporting.yang [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/$YangModelBindingProvider.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/$YangModuleInfoImpl.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/MainYangTestData.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont1.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont1Builder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainContBuilder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/MainGroup.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/SecondGroup.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/MainGroupCont.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/MainGroupContBuilder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContChoice.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrdered.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrderedBuilder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrderedKey.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnordered.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnorderedBuilder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnorderedKey.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/A.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/ABuilder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/B.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/BBuilder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/second/group/SecondGroupCont.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/second/group/SecondGroupContBuilder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/$YangModelBindingProvider.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/$YangModuleInfoImpl.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/MainYangTestImportingData.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/ImportingContainer.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/ImportingContainerBuilder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont1.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont1Builder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont2.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont2Builder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainGroupCont1.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainGroupCont1Builder.java [deleted file]
binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/package-info.java [deleted file]
binding2/prototype/yang-binding2/pom.xml [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentable.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentation.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/AugmentationHolder.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BaseIdentity.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingCodec.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingDeserializer.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingMapping.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingSerializer.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingStreamEventWriter.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/ChildTreeNode.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializer.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializerImplementation.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializerRegistry.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/IdentifiableListItem.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Identifier.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifier.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifierBuilderImpl.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InterfaceTyped.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/KeyedInstanceIdentifier.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Notification.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/NotificationListener.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcImplementation.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcInput.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcService.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/TreeNode.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/TreeRoot.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/YangModelBindingProvider.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/YangModuleInfo.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/ModuleQName.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/QName.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/RoutingContext.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/package-info.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/AbstractMappedRpcInvoker.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/AugmentationFieldGetter.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/BindingReflections.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/ClassBasedRpcServiceInvoker.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/ClassLoaderUtils.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/DataObjectReadingUtil.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/LocalNameRpcServiceInvoker.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/NotificationListenerInvoker.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/QNameRpcServiceInvoker.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvoker.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvokerWithInput.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvokerWithoutInput.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcServiceInvoker.java [deleted file]
binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/StringValueObjectFactory.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifierTest.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/FooChild.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/GroupingFoo.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/InstantiatedFoo.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Node.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChild.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChildKey.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeKey.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Nodes.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/util/BindingReflectionsTest.java [deleted file]
binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/util/DataObjectReadingUtilTest.java [deleted file]

diff --git a/binding2/prototype/pom.xml b/binding2/prototype/pom.xml
deleted file mode 100644 (file)
index 4fca7da..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <groupId>org.opendaylight.yangtools.yang.binding2</groupId>
-    <artifactId>prototype</artifactId>
-    <version>0.7.0-SNAPSHOT</version>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-common</artifactId>
-            <version>2.1.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.mdsal</groupId>
-            <artifactId>yang-binding2</artifactId>
-            <version>0.15.0-SNAPSHOT</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.5.1</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>compile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/binding2/prototype/readme.adoc b/binding2/prototype/readme.adoc
deleted file mode 100644 (file)
index b815d2e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-== Design Binding specification v2
-
-This patch represents initial prototyping of binding specification v2 where:
-
-* Java code was generated from YANG module with binding spec v1
-* manually refactored according to new v2 rules for packages
-
-
-=== Further notes:
-
-* generated structures
-* yang-binding refactored
-* grouping & data package suffix added
-* trailling whitespaces fixed
\ No newline at end of file
diff --git a/binding2/prototype/src/main/yang/mainYangTest.yang b/binding2/prototype/src/main/yang/mainYangTest.yang
deleted file mode 100644 (file)
index 6a62a54..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-module mainYangTest {
-    namespace "urn:test:mainYangTest";
-    prefix myt;
-
-    revision 2016-01-01 {
-        description "Main yang for testing spec v2";
-    }
-
-    grouping main-group {
-        container main-group-cont {
-            uses second-group;
-            leaf main-group-cont-leaf {
-                type string;
-            }
-            list main-group-cont-list-ordered {
-                ordered-by user;
-                key "name-1";
-                leaf name-1 {
-                    type string;
-                }
-                leaf type-1 {
-                    type string;
-                }
-            }
-            list main-group-cont-list-unordered {
-                key "name-2";
-                leaf name-2 {
-                    type string;
-                }
-                leaf type-2 {
-                    type string;
-                }
-            }
-            choice main-group-cont-choice {
-                case a {
-                    leaf case-1 {
-                        type string;
-                    }
-                }
-                case b {
-                    leaf case2-1 {
-                        type string;
-                    }
-                }
-            }
-            leaf leaf-ref-test {
-                type leafref {
-                    path "../main-group-cont-leaf";
-                }
-            }
-        }
-    }
-
-    grouping second-group {
-        container second-group-cont {
-            leaf second-group-cont-leaf {
-                type string;
-            }
-        }
-    }
-
-    augment "/main-cont" {
-        leaf main-augmented-leaf {
-            type string;
-        }
-    }
-
-    container main-cont {
-        uses main-group;
-    }
-}
\ No newline at end of file
diff --git a/binding2/prototype/src/main/yang/mainYangTestImporting.yang b/binding2/prototype/src/main/yang/mainYangTestImporting.yang
deleted file mode 100644 (file)
index 4a56191..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-module mainYangTestImporting {
-    namespace "urn:test:mainYangTestImporting";
-    prefix myti;
-
-    revision 2016-01-01 {
-        description "imported yang for testing spec v2";
-    }
-
-    import mainYangTest {
-        prefix imp;
-        revision-date 2016-01-01;
-    }
-
-    augment "imp:main-cont" {
-        leaf imported-augmented-leaf-1 {
-            type string;
-        }
-    }
-
-    augment "imp:main-cont" {
-        leaf imported-augmented-leaf-2 {
-            type string;
-        }
-    }
-
-    container importing-container {
-        uses imp:main-group;
-    }
-
-    augment "importing-container/main-group-cont" {
-        leaf imported-augmented-leaf-3 {
-            type string;
-        }
-    }
-}
\ No newline at end of file
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/$YangModelBindingProvider.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/$YangModelBindingProvider.java
deleted file mode 100644 (file)
index d3003fe..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest;
-
-public final class $YangModelBindingProvider implements org.opendaylight.yangtools.yang.binding.YangModelBindingProvider {
-
-    public org.opendaylight.yangtools.yang.binding.YangModuleInfo getModuleInfo() {
-        return $YangModuleInfoImpl.getInstance();
-    }
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/$YangModuleInfoImpl.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/$YangModuleInfoImpl.java
deleted file mode 100644 (file)
index 2735a1b..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import java.util.Set;
-import java.util.Collections;
-import java.io.InputStream;
-import java.io.IOException;
-public final class $YangModuleInfoImpl implements YangModuleInfo {
-
-    private static final YangModuleInfo INSTANCE = new $YangModuleInfoImpl();
-
-    private final String name = "mainYangTest";
-    private final String namespace = "urn:test:mainYangTest";
-    private final String revision = "2016-01-01";
-    private final String resourcePath = "/META-INF/yang/mainYangTest.yang";
-
-    private final Set<YangModuleInfo> importedModules;
-
-    public static YangModuleInfo getInstance() {
-        return INSTANCE;
-    }
-
-    private $YangModuleInfoImpl() {
-        importedModules = Collections.emptySet();
-
-        InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
-        if (stream == null) {
-            throw new IllegalStateException("Resource '" + resourcePath + "' is missing");
-        }
-        try {
-            stream.close();
-        } catch (IOException e) {
-        // Resource leak, but there is nothing we can do
-        }
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getRevision() {
-        return revision;
-    }
-
-    @Override
-    public String getNamespace() {
-        return namespace;
-    }
-
-    @Override
-    public InputStream getModuleSourceStream() throws IOException {
-        InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
-        if (stream == null) {
-            throw new IOException("Resource " + resourcePath + " is missing");
-        }
-        return stream;
-    }
-
-    @Override
-    public Set<YangModuleInfo> getImportedModules() {
-        return importedModules;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder(this.getClass().getCanonicalName());
-        sb.append("[");
-        sb.append("name = " + name);
-        sb.append(", namespace = " + namespace);
-        sb.append(", revision = " + revision);
-        sb.append(", resourcePath = " + resourcePath);
-        sb.append(", imports = " + importedModules);
-        sb.append("]");
-        return sb.toString();
-    }
-
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/MainYangTestData.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/MainYangTestData.java
deleted file mode 100644 (file)
index 61b3233..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont;
-import org.opendaylight.yangtools.yang.binding.TreeRoot;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * module mainYangTest {
- *     yang-version 1;
- *     namespace "urn:test:mainYangTest";
- *     prefix "myt";
- *
- *     revision 2016-01-01 {
- *         description "";
- *     }
- *
- *     container main-cont {
- *         container main-group-cont {
- *             leaf main-group-cont-leaf {
- *                 type string;
- *             }
- *             list main-group-cont-list-ordered {
- *                 key "name-1"
- *                 leaf name-1 {
- *                     type string;
- *                 }
- *                 leaf type-1 {
- *                     type string;
- *                 }
- *             }
- *             list main-group-cont-list-unordered {
- *                 key "name-2"
- *                 leaf name-2 {
- *                     type string;
- *                 }
- *                 leaf type-2 {
- *                     type string;
- *                 }
- *             }
- *             choice main-group-cont-choice {
- *                 case a {
- *                     leaf case-1 {
- *                         type string;
- *                     }
- *                 }
- *                 case b {
- *                     leaf case2-1 {
- *                         type string;
- *                     }
- *                 }
- *             }
- *             leaf leaf-ref-test {
- *                 type leafref;
- *             }
- *             container second-group-cont {
- *                 leaf second-group-cont-leaf {
- *                     type string;
- *                 }
- *             }
- *             uses second-group;
- *         }
- *         leaf main-augmented-leaf {
- *             type string;
- *         }
- *         leaf imported-augmented-leaf-1 {
- *             type string;
- *         }
- *         leaf imported-augmented-leaf-2 {
- *             type string;
- *         }
- *         augment \(urn:test:mainYangTest)main-cont {
- *             status CURRENT;
- *             leaf main-augmented-leaf {
- *                 type string;
- *             }
- *         }
- *         augment \(urn:test:mainYangTest)main-cont {
- *             status CURRENT;
- *             leaf imported-augmented-leaf-1 {
- *                 type string;
- *             }
- *         }
- *         augment \(urn:test:mainYangTest)main-cont {
- *             status CURRENT;
- *             leaf imported-augmented-leaf-2 {
- *                 type string;
- *             }
- *         }
- *         uses main-group;
- *     }
- *
- *     grouping second-group {
- *         container second-group-cont {
- *             leaf second-group-cont-leaf {
- *                 type string;
- *             }
- *         }
- *     }
- *     grouping main-group {
- *         container main-group-cont {
- *             container second-group-cont {
- *                 leaf second-group-cont-leaf {
- *                     type string;
- *                 }
- *             }
- *             leaf main-group-cont-leaf {
- *                 type string;
- *             }
- *             list main-group-cont-list-ordered {
- *                 key "name-1"
- *                 leaf name-1 {
- *                     type string;
- *                 }
- *                 leaf type-1 {
- *                     type string;
- *                 }
- *             }
- *             list main-group-cont-list-unordered {
- *                 key "name-2"
- *                 leaf name-2 {
- *                     type string;
- *                 }
- *                 leaf type-2 {
- *                     type string;
- *                 }
- *             }
- *             choice main-group-cont-choice {
- *                 case a {
- *                     leaf case-1 {
- *                         type string;
- *                     }
- *                 }
- *                 case b {
- *                     leaf case2-1 {
- *                         type string;
- *                     }
- *                 }
- *             }
- *             leaf leaf-ref-test {
- *                 type leafref;
- *             }
- *             uses second-group;
- *         }
- *     }
- *
- *     augment \(urn:test:mainYangTest)main-cont {
- *         status CURRENT;
- *         leaf main-augmented-leaf {
- *             type string;
- *         }
- *     }
- * }
- * </pre>
- *
- */
-public interface MainYangTestData
-    extends
-        TreeRoot
-{
-
-
-
-
-    MainCont getMainCont();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont.java
deleted file mode 100644 (file)
index cb0490b..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data;
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.MainYangTestData;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * container main-cont {
- *     container main-group-cont {
- *         leaf main-group-cont-leaf {
- *             type string;
- *         }
- *         list main-group-cont-list-ordered {
- *             key "name-1"
- *             leaf name-1 {
- *                 type string;
- *             }
- *             leaf type-1 {
- *                 type string;
- *             }
- *         }
- *         list main-group-cont-list-unordered {
- *             key "name-2"
- *             leaf name-2 {
- *                 type string;
- *             }
- *             leaf type-2 {
- *                 type string;
- *             }
- *         }
- *         choice main-group-cont-choice {
- *             case a {
- *                 leaf case-1 {
- *                     type string;
- *                 }
- *             }
- *             case b {
- *                 leaf case2-1 {
- *                     type string;
- *                 }
- *             }
- *         }
- *         leaf leaf-ref-test {
- *             type leafref;
- *         }
- *         container second-group-cont {
- *             leaf second-group-cont-leaf {
- *                 type string;
- *             }
- *         }
- *         uses second-group;
- *     }
- *     leaf main-augmented-leaf {
- *         type string;
- *     }
- *     leaf imported-augmented-leaf-1 {
- *         type string;
- *     }
- *     leaf imported-augmented-leaf-2 {
- *         type string;
- *     }
- *     augment \(urn:test:mainYangTest)main-cont {
- *         status CURRENT;
- *         leaf main-augmented-leaf {
- *             type string;
- *         }
- *     }
- *     augment \(urn:test:mainYangTest)main-cont {
- *         status CURRENT;
- *         leaf imported-augmented-leaf-1 {
- *             type string;
- *         }
- *     }
- *     augment \(urn:test:mainYangTest)main-cont {
- *         status CURRENT;
- *         leaf imported-augmented-leaf-2 {
- *             type string;
- *         }
- *     }
- *     uses main-group;
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/main-cont</i>
- *
- * <p>To create instances of this class use {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainContBuilder}.
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainContBuilder
- *
- */
-public interface MainCont
-    extends
-        ChildTreeNode<MainYangTestData>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>,
-    MainGroup
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "main-cont").intern();
-
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont1.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont1.java
deleted file mode 100644 (file)
index c919f5d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-
-
-public interface MainCont1
-    extends
-        TreeNode,
-    Augmentation<MainCont>
-{
-
-
-
-
-    java.lang.String getMainAugmentedLeaf();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont1Builder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainCont1Builder.java
deleted file mode 100644 (file)
index a9779a4..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont1} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont1
- *
- */
-public class MainCont1Builder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont1> {
-
-    private java.lang.String _mainAugmentedLeaf;
-
-
-    public MainCont1Builder() {
-    }
-
-    public MainCont1Builder(MainCont1 base) {
-        this._mainAugmentedLeaf = base.getMainAugmentedLeaf();
-    }
-
-
-    public java.lang.String getMainAugmentedLeaf() {
-        return _mainAugmentedLeaf;
-    }
-
-
-    public MainCont1Builder setMainAugmentedLeaf(final java.lang.String value) {
-        this._mainAugmentedLeaf = value;
-        return this;
-    }
-
-    public MainCont1 build() {
-        return new MainCont1Impl(this);
-    }
-
-    private static final class MainCont1Impl implements MainCont1 {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont1> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont1.class;
-        }
-
-        private final java.lang.String _mainAugmentedLeaf;
-
-
-        private MainCont1Impl(MainCont1Builder base) {
-            this._mainAugmentedLeaf = base.getMainAugmentedLeaf();
-        }
-
-        @Override
-        public java.lang.String getMainAugmentedLeaf() {
-            return _mainAugmentedLeaf;
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_mainAugmentedLeaf);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont1.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont1 other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont1)obj;
-            if (!Objects.equals(_mainAugmentedLeaf, other.getMainAugmentedLeaf())) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("MainCont1 [");
-            boolean first = true;
-
-            if (_mainAugmentedLeaf != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_mainAugmentedLeaf=");
-                builder.append(_mainAugmentedLeaf);
-             }
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainContBuilder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/data/MainContBuilder.java
deleted file mode 100644 (file)
index 1bc3300..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import java.util.HashMap;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-import java.util.Collections;
-import java.util.Map;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont
- *
- */
-public class MainContBuilder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont> {
-
-    private MainGroupCont _mainGroupCont;
-
-    Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>> augmentation = Collections.emptyMap();
-
-    public MainContBuilder() {
-    }
-    public MainContBuilder(org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup arg) {
-        this._mainGroupCont = arg.getMainGroupCont();
-    }
-
-    public MainContBuilder(MainCont base) {
-        this._mainGroupCont = base.getMainGroupCont();
-        if (base instanceof MainContImpl) {
-            MainContImpl impl = (MainContImpl) base;
-            if (!impl.augmentation.isEmpty()) {
-                this.augmentation = new HashMap<>(impl.augmentation);
-            }
-        } else if (base instanceof AugmentationHolder) {
-            @SuppressWarnings("unchecked")
-            AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>) base;
-            if (!casted.augmentations().isEmpty()) {
-                this.augmentation = new HashMap<>(casted.augmentations());
-            }
-        }
-    }
-
-    /**
-     *Set fields from given grouping argument. Valid argument is instance of one of following types:
-     * <ul>
-     * <li>org.opendaylight.yang.gen.v1.urn.test.mainyangtest.rev160101.MainGroup</li>
-     * </ul>
-     *
-     * @param arg grouping object
-     * @throws IllegalArgumentException if given argument is none of valid types
-    */
-    public void fieldsFrom(TreeNode arg) {
-        boolean isValidArg = false;
-        if (arg instanceof org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup) {
-            this._mainGroupCont = ((org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup)arg).getMainGroupCont();
-            isValidArg = true;
-        }
-        if (!isValidArg) {
-            throw new IllegalArgumentException(
-              "expected one of: [org.opendaylight.yang.gen.v1.urn.test.mainyangtest.rev160101.MainGroup] \n" +
-              "but was: " + arg
-            );
-        }
-    }
-
-    public MainGroupCont getMainGroupCont() {
-        return _mainGroupCont;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>> E getAugmentation(java.lang.Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-
-    public MainContBuilder setMainGroupCont(final MainGroupCont value) {
-        this._mainGroupCont = value;
-        return this;
-    }
-
-    public MainContBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont> augmentation) {
-        if (augmentation == null) {
-            return removeAugmentation(augmentationType);
-        }
-
-        if (!(this.augmentation instanceof HashMap)) {
-            this.augmentation = new HashMap<>();
-        }
-
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public MainContBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>> augmentationType) {
-        if (this.augmentation instanceof HashMap) {
-            this.augmentation.remove(augmentationType);
-        }
-        return this;
-    }
-
-    public MainCont build() {
-        return new MainContImpl(this);
-    }
-
-    private static final class MainContImpl implements MainCont {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont.class;
-        }
-
-        private final MainGroupCont _mainGroupCont;
-
-        private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>> augmentation = Collections.emptyMap();
-
-        private MainContImpl(MainContBuilder base) {
-            this._mainGroupCont = base.getMainGroupCont();
-            switch (base.augmentation.size()) {
-            case 0:
-                this.augmentation = Collections.emptyMap();
-                break;
-            case 1:
-                final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>> e = base.augmentation.entrySet().iterator().next();
-                this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>>singletonMap(e.getKey(), e.getValue());
-                break;
-            default :
-                this.augmentation = new HashMap<>(base.augmentation);
-            }
-        }
-
-        @Override
-        public MainGroupCont getMainGroupCont() {
-            return _mainGroupCont;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>> E getAugmentation(java.lang.Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_mainGroupCont);
-            result = prime * result + Objects.hashCode(augmentation);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont)obj;
-            if (!Objects.equals(_mainGroupCont, other.getMainGroupCont())) {
-                return false;
-            }
-            if (getClass() == obj.getClass()) {
-                // Simple case: we are comparing against self
-                MainContImpl otherImpl = (MainContImpl) obj;
-                if (!Objects.equals(augmentation, otherImpl.augmentation)) {
-                    return false;
-                }
-            } else {
-                // Hard case: compare our augments with presence there...
-                for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont>> e : augmentation.entrySet()) {
-                    if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
-                        return false;
-                    }
-                }
-                // .. and give the other one the chance to do the same
-                if (!obj.equals(this)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("MainCont [");
-            boolean first = true;
-
-            if (_mainGroupCont != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_mainGroupCont=");
-                builder.append(_mainGroupCont);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/MainGroup.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/MainGroup.java
deleted file mode 100644 (file)
index 6ce57c3..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * grouping main-group {
- *     container main-group-cont {
- *         container second-group-cont {
- *             leaf second-group-cont-leaf {
- *                 type string;
- *             }
- *         }
- *         leaf main-group-cont-leaf {
- *             type string;
- *         }
- *         list main-group-cont-list-ordered {
- *             key "name-1"
- *             leaf name-1 {
- *                 type string;
- *             }
- *             leaf type-1 {
- *                 type string;
- *             }
- *         }
- *         list main-group-cont-list-unordered {
- *             key "name-2"
- *             leaf name-2 {
- *                 type string;
- *             }
- *             leaf type-2 {
- *                 type string;
- *             }
- *         }
- *         choice main-group-cont-choice {
- *             case a {
- *                 leaf case-1 {
- *                     type string;
- *                 }
- *             }
- *             case b {
- *                 leaf case2-1 {
- *                     type string;
- *                 }
- *             }
- *         }
- *         leaf leaf-ref-test {
- *             type leafref;
- *         }
- *         uses second-group;
- *     }
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/main-group</i>
- *
- */
-public interface MainGroup
-    extends
-        TreeNode
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "main-group").intern();
-
-    MainGroupCont getMainGroupCont();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/SecondGroup.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/SecondGroup.java
deleted file mode 100644 (file)
index 5e1fde3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * grouping second-group {
- *     container second-group-cont {
- *         leaf second-group-cont-leaf {
- *             type string;
- *         }
- *     }
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/second-group</i>
- *
- */
-public interface SecondGroup
-    extends
-        TreeNode
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "second-group").intern();
-
-    SecondGroupCont getSecondGroupCont();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/MainGroupCont.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/MainGroupCont.java
deleted file mode 100644 (file)
index 44d7fb6..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group;
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-import java.util.List;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.SecondGroup;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContChoice;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * container main-group-cont {
- *     container second-group-cont {
- *         leaf second-group-cont-leaf {
- *             type string;
- *         }
- *     }
- *     leaf main-group-cont-leaf {
- *         type string;
- *     }
- *     list main-group-cont-list-ordered {
- *         key "name-1"
- *         leaf name-1 {
- *             type string;
- *         }
- *         leaf type-1 {
- *             type string;
- *         }
- *     }
- *     list main-group-cont-list-unordered {
- *         key "name-2"
- *         leaf name-2 {
- *             type string;
- *         }
- *         leaf type-2 {
- *             type string;
- *         }
- *     }
- *     choice main-group-cont-choice {
- *         case a {
- *             leaf case-1 {
- *                 type string;
- *             }
- *         }
- *         case b {
- *             leaf case2-1 {
- *                 type string;
- *             }
- *         }
- *     }
- *     leaf leaf-ref-test {
- *         type leafref;
- *     }
- *     uses second-group;
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/main-group/main-group-cont</i>
- *
- * <p>To create instances of this class use {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupContBuilder}.
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupContBuilder
- *
- */
-public interface MainGroupCont
-    extends
-        ChildTreeNode<MainGroup>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>,
-    SecondGroup
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "main-group-cont").intern();
-
-    java.lang.String getMainGroupContLeaf();
-
-    List<MainGroupContListOrdered> getMainGroupContListOrdered();
-
-    List<MainGroupContListUnordered> getMainGroupContListUnordered();
-
-    MainGroupContChoice getMainGroupContChoice();
-
-    java.lang.String getLeafRefTest();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/MainGroupContBuilder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/MainGroupContBuilder.java
deleted file mode 100644 (file)
index 07a6596..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import java.util.HashMap;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContChoice;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import java.util.Objects;
-import java.util.List;
-import java.util.Collections;
-import java.util.Map;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont
- *
- */
-public class MainGroupContBuilder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont> {
-
-    private java.lang.String _leafRefTest;
-    private MainGroupContChoice _mainGroupContChoice;
-    private java.lang.String _mainGroupContLeaf;
-    private List<MainGroupContListOrdered> _mainGroupContListOrdered;
-    private List<MainGroupContListUnordered> _mainGroupContListUnordered;
-    private SecondGroupCont _secondGroupCont;
-
-    Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>> augmentation = Collections.emptyMap();
-
-    public MainGroupContBuilder() {
-    }
-    public MainGroupContBuilder(org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.SecondGroup arg) {
-        this._secondGroupCont = arg.getSecondGroupCont();
-    }
-
-    public MainGroupContBuilder(MainGroupCont base) {
-        this._leafRefTest = base.getLeafRefTest();
-        this._mainGroupContChoice = base.getMainGroupContChoice();
-        this._mainGroupContLeaf = base.getMainGroupContLeaf();
-        this._mainGroupContListOrdered = base.getMainGroupContListOrdered();
-        this._mainGroupContListUnordered = base.getMainGroupContListUnordered();
-        this._secondGroupCont = base.getSecondGroupCont();
-        if (base instanceof MainGroupContImpl) {
-            MainGroupContImpl impl = (MainGroupContImpl) base;
-            if (!impl.augmentation.isEmpty()) {
-                this.augmentation = new HashMap<>(impl.augmentation);
-            }
-        } else if (base instanceof AugmentationHolder) {
-            @SuppressWarnings("unchecked")
-            AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>) base;
-            if (!casted.augmentations().isEmpty()) {
-                this.augmentation = new HashMap<>(casted.augmentations());
-            }
-        }
-    }
-
-    /**
-     *Set fields from given grouping argument. Valid argument is instance of one of following types:
-     * <ul>
-     * <li>org.opendaylight.yang.gen.v1.urn.test.mainyangtest.rev160101.SecondGroup</li>
-     * </ul>
-     *
-     * @param arg grouping object
-     * @throws IllegalArgumentException if given argument is none of valid types
-    */
-    public void fieldsFrom(TreeNode arg) {
-        boolean isValidArg = false;
-        if (arg instanceof org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.SecondGroup) {
-            this._secondGroupCont = ((org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.SecondGroup)arg).getSecondGroupCont();
-            isValidArg = true;
-        }
-        if (!isValidArg) {
-            throw new IllegalArgumentException(
-              "expected one of: [org.opendaylight.yang.gen.v1.urn.test.mainyangtest.rev160101.SecondGroup] \n" +
-              "but was: " + arg
-            );
-        }
-    }
-
-    public java.lang.String getLeafRefTest() {
-        return _leafRefTest;
-    }
-
-    public MainGroupContChoice getMainGroupContChoice() {
-        return _mainGroupContChoice;
-    }
-
-    public java.lang.String getMainGroupContLeaf() {
-        return _mainGroupContLeaf;
-    }
-
-    public List<MainGroupContListOrdered> getMainGroupContListOrdered() {
-        return _mainGroupContListOrdered;
-    }
-
-    public List<MainGroupContListUnordered> getMainGroupContListUnordered() {
-        return _mainGroupContListUnordered;
-    }
-
-    public SecondGroupCont getSecondGroupCont() {
-        return _secondGroupCont;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>> E getAugmentation(java.lang.Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-
-    public MainGroupContBuilder setLeafRefTest(final java.lang.String value) {
-        this._leafRefTest = value;
-        return this;
-    }
-
-
-    public MainGroupContBuilder setMainGroupContChoice(final MainGroupContChoice value) {
-        this._mainGroupContChoice = value;
-        return this;
-    }
-
-
-    public MainGroupContBuilder setMainGroupContLeaf(final java.lang.String value) {
-        this._mainGroupContLeaf = value;
-        return this;
-    }
-
-
-    public MainGroupContBuilder setMainGroupContListOrdered(final List<MainGroupContListOrdered> value) {
-        this._mainGroupContListOrdered = value;
-        return this;
-    }
-
-
-    public MainGroupContBuilder setMainGroupContListUnordered(final List<MainGroupContListUnordered> value) {
-        this._mainGroupContListUnordered = value;
-        return this;
-    }
-
-
-    public MainGroupContBuilder setSecondGroupCont(final SecondGroupCont value) {
-        this._secondGroupCont = value;
-        return this;
-    }
-
-    public MainGroupContBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont> augmentation) {
-        if (augmentation == null) {
-            return removeAugmentation(augmentationType);
-        }
-
-        if (!(this.augmentation instanceof HashMap)) {
-            this.augmentation = new HashMap<>();
-        }
-
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public MainGroupContBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>> augmentationType) {
-        if (this.augmentation instanceof HashMap) {
-            this.augmentation.remove(augmentationType);
-        }
-        return this;
-    }
-
-    public MainGroupCont build() {
-        return new MainGroupContImpl(this);
-    }
-
-    private static final class MainGroupContImpl implements MainGroupCont {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont.class;
-        }
-
-        private final java.lang.String _leafRefTest;
-        private final MainGroupContChoice _mainGroupContChoice;
-        private final java.lang.String _mainGroupContLeaf;
-        private final List<MainGroupContListOrdered> _mainGroupContListOrdered;
-        private final List<MainGroupContListUnordered> _mainGroupContListUnordered;
-        private final SecondGroupCont _secondGroupCont;
-
-        private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>> augmentation = Collections.emptyMap();
-
-        private MainGroupContImpl(MainGroupContBuilder base) {
-            this._leafRefTest = base.getLeafRefTest();
-            this._mainGroupContChoice = base.getMainGroupContChoice();
-            this._mainGroupContLeaf = base.getMainGroupContLeaf();
-            this._mainGroupContListOrdered = base.getMainGroupContListOrdered();
-            this._mainGroupContListUnordered = base.getMainGroupContListUnordered();
-            this._secondGroupCont = base.getSecondGroupCont();
-            switch (base.augmentation.size()) {
-            case 0:
-                this.augmentation = Collections.emptyMap();
-                break;
-            case 1:
-                final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>> e = base.augmentation.entrySet().iterator().next();
-                this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>>singletonMap(e.getKey(), e.getValue());
-                break;
-            default :
-                this.augmentation = new HashMap<>(base.augmentation);
-            }
-        }
-
-        @Override
-        public java.lang.String getLeafRefTest() {
-            return _leafRefTest;
-        }
-
-        @Override
-        public MainGroupContChoice getMainGroupContChoice() {
-            return _mainGroupContChoice;
-        }
-
-        @Override
-        public java.lang.String getMainGroupContLeaf() {
-            return _mainGroupContLeaf;
-        }
-
-        @Override
-        public List<MainGroupContListOrdered> getMainGroupContListOrdered() {
-            return _mainGroupContListOrdered;
-        }
-
-        @Override
-        public List<MainGroupContListUnordered> getMainGroupContListUnordered() {
-            return _mainGroupContListUnordered;
-        }
-
-        @Override
-        public SecondGroupCont getSecondGroupCont() {
-            return _secondGroupCont;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>> E getAugmentation(java.lang.Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_leafRefTest);
-            result = prime * result + Objects.hashCode(_mainGroupContChoice);
-            result = prime * result + Objects.hashCode(_mainGroupContLeaf);
-            result = prime * result + Objects.hashCode(_mainGroupContListOrdered);
-            result = prime * result + Objects.hashCode(_mainGroupContListUnordered);
-            result = prime * result + Objects.hashCode(_secondGroupCont);
-            result = prime * result + Objects.hashCode(augmentation);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont)obj;
-            if (!Objects.equals(_leafRefTest, other.getLeafRefTest())) {
-                return false;
-            }
-            if (!Objects.equals(_mainGroupContChoice, other.getMainGroupContChoice())) {
-                return false;
-            }
-            if (!Objects.equals(_mainGroupContLeaf, other.getMainGroupContLeaf())) {
-                return false;
-            }
-            if (!Objects.equals(_mainGroupContListOrdered, other.getMainGroupContListOrdered())) {
-                return false;
-            }
-            if (!Objects.equals(_mainGroupContListUnordered, other.getMainGroupContListUnordered())) {
-                return false;
-            }
-            if (!Objects.equals(_secondGroupCont, other.getSecondGroupCont())) {
-                return false;
-            }
-            if (getClass() == obj.getClass()) {
-                // Simple case: we are comparing against self
-                MainGroupContImpl otherImpl = (MainGroupContImpl) obj;
-                if (!Objects.equals(augmentation, otherImpl.augmentation)) {
-                    return false;
-                }
-            } else {
-                // Hard case: compare our augments with presence there...
-                for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont>> e : augmentation.entrySet()) {
-                    if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
-                        return false;
-                    }
-                }
-                // .. and give the other one the chance to do the same
-                if (!obj.equals(this)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("MainGroupCont [");
-            boolean first = true;
-
-            if (_leafRefTest != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_leafRefTest=");
-                builder.append(_leafRefTest);
-             }
-            if (_mainGroupContChoice != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_mainGroupContChoice=");
-                builder.append(_mainGroupContChoice);
-             }
-            if (_mainGroupContLeaf != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_mainGroupContLeaf=");
-                builder.append(_mainGroupContLeaf);
-             }
-            if (_mainGroupContListOrdered != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_mainGroupContListOrdered=");
-                builder.append(_mainGroupContListOrdered);
-             }
-            if (_mainGroupContListUnordered != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_mainGroupContListUnordered=");
-                builder.append(_mainGroupContListUnordered);
-             }
-            if (_secondGroupCont != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_secondGroupCont=");
-                builder.append(_secondGroupCont);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContChoice.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContChoice.java
deleted file mode 100644 (file)
index 86a4be0..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont;
-import org.opendaylight.yangtools.yang.binding.InterfaceTyped;
-import org.opendaylight.yangtools.yang.common.QName;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * choice main-group-cont-choice {
- *     case a {
- *         leaf case-1 {
- *             type string;
- *         }
- *     }
- *     case b {
- *         leaf case2-1 {
- *             type string;
- *         }
- *     }
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/main-group/main-group-cont/main-group-cont-choice</i>
- *
- */
-public interface MainGroupContChoice
-    extends
-        InterfaceTyped
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "main-group-cont-choice").intern();
-
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrdered.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrdered.java
deleted file mode 100644 (file)
index 640266e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont;
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yangtools.yang.binding.IdentifiableListItem;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * list main-group-cont-list-ordered {
- *     key "name-1"
- *     leaf name-1 {
- *         type string;
- *     }
- *     leaf type-1 {
- *         type string;
- *     }
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/main-group/main-group-cont/main-group-cont-list-ordered</i>
- *
- * <p>To create instances of this class use {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrderedBuilder}.
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrderedBuilder
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrderedKey
- *
- */
-public interface MainGroupContListOrdered
-    extends
-        ChildTreeNode<MainGroupCont>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>,
-        IdentifiableListItem<MainGroupContListOrderedKey>
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "main-group-cont-list-ordered").intern();
-
-    java.lang.String getName1();
-
-    java.lang.String getType1();
-
-    /**
-     * Returns Primary Key of Yang List Type
-     *
-     */
-    MainGroupContListOrderedKey identifier();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrderedBuilder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrderedBuilder.java
deleted file mode 100644 (file)
index a6f1368..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import java.util.HashMap;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-import java.util.Collections;
-import java.util.Map;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered
- *
- */
-public class MainGroupContListOrderedBuilder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered> {
-
-    private MainGroupContListOrderedKey _key;
-    private java.lang.String _name1;
-    private java.lang.String _type1;
-
-    Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>> augmentation = Collections.emptyMap();
-
-    public MainGroupContListOrderedBuilder() {
-    }
-
-    public MainGroupContListOrderedBuilder(MainGroupContListOrdered base) {
-        if (base.identifier() == null) {
-            this._key = new MainGroupContListOrderedKey(
-                base.getName1()
-            );
-            this._name1 = base.getName1();
-        } else {
-            this._key = base.identifier();
-            this._name1 = _key.getName1();
-        }
-        this._type1 = base.getType1();
-        if (base instanceof MainGroupContListOrderedImpl) {
-            MainGroupContListOrderedImpl impl = (MainGroupContListOrderedImpl) base;
-            if (!impl.augmentation.isEmpty()) {
-                this.augmentation = new HashMap<>(impl.augmentation);
-            }
-        } else if (base instanceof AugmentationHolder) {
-            @SuppressWarnings("unchecked")
-            AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>) base;
-            if (!casted.augmentations().isEmpty()) {
-                this.augmentation = new HashMap<>(casted.augmentations());
-            }
-        }
-    }
-
-
-    public MainGroupContListOrderedKey getKey() {
-        return _key;
-    }
-
-    public java.lang.String getName1() {
-        return _name1;
-    }
-
-    public java.lang.String getType1() {
-        return _type1;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>> E getAugmentation(java.lang.Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-
-    public MainGroupContListOrderedBuilder setKey(final MainGroupContListOrderedKey value) {
-        this._key = value;
-        return this;
-    }
-
-
-    public MainGroupContListOrderedBuilder setName1(final java.lang.String value) {
-        this._name1 = value;
-        return this;
-    }
-
-
-    public MainGroupContListOrderedBuilder setType1(final java.lang.String value) {
-        this._type1 = value;
-        return this;
-    }
-
-    public MainGroupContListOrderedBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered> augmentation) {
-        if (augmentation == null) {
-            return removeAugmentation(augmentationType);
-        }
-
-        if (!(this.augmentation instanceof HashMap)) {
-            this.augmentation = new HashMap<>();
-        }
-
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public MainGroupContListOrderedBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>> augmentationType) {
-        if (this.augmentation instanceof HashMap) {
-            this.augmentation.remove(augmentationType);
-        }
-        return this;
-    }
-
-    public MainGroupContListOrdered build() {
-        return new MainGroupContListOrderedImpl(this);
-    }
-
-    private static final class MainGroupContListOrderedImpl implements MainGroupContListOrdered {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered.class;
-        }
-
-        private final MainGroupContListOrderedKey _key;
-        private final java.lang.String _name1;
-        private final java.lang.String _type1;
-
-        private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>> augmentation = Collections.emptyMap();
-
-        private MainGroupContListOrderedImpl(MainGroupContListOrderedBuilder base) {
-            if (base.getKey() == null) {
-                this._key = new MainGroupContListOrderedKey(
-                    base.getName1()
-                );
-                this._name1 = base.getName1();
-            } else {
-                this._key = base.getKey();
-                this._name1 = _key.getName1();
-            }
-            this._type1 = base.getType1();
-            switch (base.augmentation.size()) {
-            case 0:
-                this.augmentation = Collections.emptyMap();
-                break;
-            case 1:
-                final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>> e = base.augmentation.entrySet().iterator().next();
-                this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>>singletonMap(e.getKey(), e.getValue());
-                break;
-            default :
-                this.augmentation = new HashMap<>(base.augmentation);
-            }
-        }
-
-        @Override
-        public MainGroupContListOrderedKey identifier() {
-            return _key;
-        }
-
-        @Override
-        public java.lang.String getName1() {
-            return _name1;
-        }
-
-        @Override
-        public java.lang.String getType1() {
-            return _type1;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>> E getAugmentation(java.lang.Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_key);
-            result = prime * result + Objects.hashCode(_name1);
-            result = prime * result + Objects.hashCode(_type1);
-            result = prime * result + Objects.hashCode(augmentation);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered)obj;
-            if (!Objects.equals(_key, other.identifier())) {
-                return false;
-            }
-            if (!Objects.equals(_name1, other.getName1())) {
-                return false;
-            }
-            if (!Objects.equals(_type1, other.getType1())) {
-                return false;
-            }
-            if (getClass() == obj.getClass()) {
-                // Simple case: we are comparing against self
-                MainGroupContListOrderedImpl otherImpl = (MainGroupContListOrderedImpl) obj;
-                if (!Objects.equals(augmentation, otherImpl.augmentation)) {
-                    return false;
-                }
-            } else {
-                // Hard case: compare our augments with presence there...
-                for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrdered>> e : augmentation.entrySet()) {
-                    if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
-                        return false;
-                    }
-                }
-                // .. and give the other one the chance to do the same
-                if (!obj.equals(this)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("MainGroupContListOrdered [");
-            boolean first = true;
-
-            if (_key != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_key=");
-                builder.append(_key);
-             }
-            if (_name1 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_name1=");
-                builder.append(_name1);
-             }
-            if (_type1 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_type1=");
-                builder.append(_type1);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrderedKey.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListOrderedKey.java
deleted file mode 100644 (file)
index 857620f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont;
-import org.opendaylight.yangtools.yang.binding.Identifier;
-import java.util.Objects;
-
-
-public class MainGroupContListOrderedKey
- implements Identifier<MainGroupContListOrdered> {
-    private static final long serialVersionUID = -7926731649945418745L;
-    private final java.lang.String _name1;
-
-
-    public MainGroupContListOrderedKey(java.lang.String _name1) {
-
-
-        this._name1 = _name1;
-    }
-
-    /**
-     * Creates a copy from Source Object.
-     *
-     * @param source Source object
-     */
-    public MainGroupContListOrderedKey(MainGroupContListOrderedKey source) {
-        this._name1 = source._name1;
-    }
-
-
-    public java.lang.String getName1() {
-        return _name1;
-    }
-
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + Objects.hashCode(_name1);
-        return result;
-    }
-
-    @Override
-    public boolean equals(java.lang.Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        MainGroupContListOrderedKey other = (MainGroupContListOrderedKey) obj;
-        if (!Objects.equals(_name1, other._name1)) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public java.lang.String toString() {
-        java.lang.StringBuilder builder = new java.lang.StringBuilder(org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListOrderedKey.class.getSimpleName()).append(" [");
-        boolean first = true;
-
-        if (_name1 != null) {
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("_name1=");
-            builder.append(_name1);
-         }
-        return builder.append(']').toString();
-    }
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnordered.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnordered.java
deleted file mode 100644 (file)
index 79dcabe..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont;
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yangtools.yang.binding.IdentifiableListItem;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * list main-group-cont-list-unordered {
- *     key "name-2"
- *     leaf name-2 {
- *         type string;
- *     }
- *     leaf type-2 {
- *         type string;
- *     }
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/main-group/main-group-cont/main-group-cont-list-unordered</i>
- *
- * <p>To create instances of this class use {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnorderedBuilder}.
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnorderedBuilder
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnorderedKey
- *
- */
-public interface MainGroupContListUnordered
-    extends
-        ChildTreeNode<MainGroupCont>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>,
-        IdentifiableListItem<MainGroupContListUnorderedKey>
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "main-group-cont-list-unordered").intern();
-
-    java.lang.String getName2();
-
-    java.lang.String getType2();
-
-    /**
-     * Returns Primary Key of Yang List Type
-     *
-     */
-    MainGroupContListUnorderedKey identifier();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnorderedBuilder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnorderedBuilder.java
deleted file mode 100644 (file)
index b46ba35..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import java.util.HashMap;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-import java.util.Collections;
-import java.util.Map;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered
- *
- */
-public class MainGroupContListUnorderedBuilder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered> {
-
-    private MainGroupContListUnorderedKey _key;
-    private java.lang.String _name2;
-    private java.lang.String _type2;
-
-    Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>> augmentation = Collections.emptyMap();
-
-    public MainGroupContListUnorderedBuilder() {
-    }
-
-    public MainGroupContListUnorderedBuilder(MainGroupContListUnordered base) {
-        if (base.identifier() == null) {
-            this._key = new MainGroupContListUnorderedKey(
-                base.getName2()
-            );
-            this._name2 = base.getName2();
-        } else {
-            this._key = base.identifier();
-            this._name2 = _key.getName2();
-        }
-        this._type2 = base.getType2();
-        if (base instanceof MainGroupContListUnorderedImpl) {
-            MainGroupContListUnorderedImpl impl = (MainGroupContListUnorderedImpl) base;
-            if (!impl.augmentation.isEmpty()) {
-                this.augmentation = new HashMap<>(impl.augmentation);
-            }
-        } else if (base instanceof AugmentationHolder) {
-            @SuppressWarnings("unchecked")
-            AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>) base;
-            if (!casted.augmentations().isEmpty()) {
-                this.augmentation = new HashMap<>(casted.augmentations());
-            }
-        }
-    }
-
-
-    public MainGroupContListUnorderedKey getKey() {
-        return _key;
-    }
-
-    public java.lang.String getName2() {
-        return _name2;
-    }
-
-    public java.lang.String getType2() {
-        return _type2;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>> E getAugmentation(java.lang.Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-
-    public MainGroupContListUnorderedBuilder setKey(final MainGroupContListUnorderedKey value) {
-        this._key = value;
-        return this;
-    }
-
-
-    public MainGroupContListUnorderedBuilder setName2(final java.lang.String value) {
-        this._name2 = value;
-        return this;
-    }
-
-
-    public MainGroupContListUnorderedBuilder setType2(final java.lang.String value) {
-        this._type2 = value;
-        return this;
-    }
-
-    public MainGroupContListUnorderedBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered> augmentation) {
-        if (augmentation == null) {
-            return removeAugmentation(augmentationType);
-        }
-
-        if (!(this.augmentation instanceof HashMap)) {
-            this.augmentation = new HashMap<>();
-        }
-
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public MainGroupContListUnorderedBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>> augmentationType) {
-        if (this.augmentation instanceof HashMap) {
-            this.augmentation.remove(augmentationType);
-        }
-        return this;
-    }
-
-    public MainGroupContListUnordered build() {
-        return new MainGroupContListUnorderedImpl(this);
-    }
-
-    private static final class MainGroupContListUnorderedImpl implements MainGroupContListUnordered {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered.class;
-        }
-
-        private final MainGroupContListUnorderedKey _key;
-        private final java.lang.String _name2;
-        private final java.lang.String _type2;
-
-        private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>> augmentation = Collections.emptyMap();
-
-        private MainGroupContListUnorderedImpl(MainGroupContListUnorderedBuilder base) {
-            if (base.getKey() == null) {
-                this._key = new MainGroupContListUnorderedKey(
-                    base.getName2()
-                );
-                this._name2 = base.getName2();
-            } else {
-                this._key = base.getKey();
-                this._name2 = _key.getName2();
-            }
-            this._type2 = base.getType2();
-            switch (base.augmentation.size()) {
-            case 0:
-                this.augmentation = Collections.emptyMap();
-                break;
-            case 1:
-                final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>> e = base.augmentation.entrySet().iterator().next();
-                this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>>singletonMap(e.getKey(), e.getValue());
-                break;
-            default :
-                this.augmentation = new HashMap<>(base.augmentation);
-            }
-        }
-
-        @Override
-        public MainGroupContListUnorderedKey identifier() {
-            return _key;
-        }
-
-        @Override
-        public java.lang.String getName2() {
-            return _name2;
-        }
-
-        @Override
-        public java.lang.String getType2() {
-            return _type2;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>> E getAugmentation(java.lang.Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_key);
-            result = prime * result + Objects.hashCode(_name2);
-            result = prime * result + Objects.hashCode(_type2);
-            result = prime * result + Objects.hashCode(augmentation);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered)obj;
-            if (!Objects.equals(_key, other.identifier())) {
-                return false;
-            }
-            if (!Objects.equals(_name2, other.getName2())) {
-                return false;
-            }
-            if (!Objects.equals(_type2, other.getType2())) {
-                return false;
-            }
-            if (getClass() == obj.getClass()) {
-                // Simple case: we are comparing against self
-                MainGroupContListUnorderedImpl otherImpl = (MainGroupContListUnorderedImpl) obj;
-                if (!Objects.equals(augmentation, otherImpl.augmentation)) {
-                    return false;
-                }
-            } else {
-                // Hard case: compare our augments with presence there...
-                for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnordered>> e : augmentation.entrySet()) {
-                    if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
-                        return false;
-                    }
-                }
-                // .. and give the other one the chance to do the same
-                if (!obj.equals(this)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("MainGroupContListUnordered [");
-            boolean first = true;
-
-            if (_key != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_key=");
-                builder.append(_key);
-             }
-            if (_name2 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_name2=");
-                builder.append(_name2);
-             }
-            if (_type2 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_type2=");
-                builder.append(_type2);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnorderedKey.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/MainGroupContListUnorderedKey.java
deleted file mode 100644 (file)
index 4104774..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont;
-import org.opendaylight.yangtools.yang.binding.Identifier;
-import java.util.Objects;
-
-
-public class MainGroupContListUnorderedKey
- implements Identifier<MainGroupContListUnordered> {
-    private static final long serialVersionUID = 3614369169157466116L;
-    private final java.lang.String _name2;
-
-
-    public MainGroupContListUnorderedKey(java.lang.String _name2) {
-
-
-        this._name2 = _name2;
-    }
-
-    /**
-     * Creates a copy from Source Object.
-     *
-     * @param source Source object
-     */
-    public MainGroupContListUnorderedKey(MainGroupContListUnorderedKey source) {
-        this._name2 = source._name2;
-    }
-
-
-    public java.lang.String getName2() {
-        return _name2;
-    }
-
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + Objects.hashCode(_name2);
-        return result;
-    }
-
-    @Override
-    public boolean equals(java.lang.Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        MainGroupContListUnorderedKey other = (MainGroupContListUnorderedKey) obj;
-        if (!Objects.equals(_name2, other._name2)) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public java.lang.String toString() {
-        java.lang.StringBuilder builder = new java.lang.StringBuilder(org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContListUnorderedKey.class.getSimpleName()).append(" [");
-        boolean first = true;
-
-        if (_name2 != null) {
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("_name2=");
-            builder.append(_name2);
-         }
-        return builder.append(']').toString();
-    }
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/A.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/A.java
deleted file mode 100644 (file)
index a449fc3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContChoice;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * case a {
- *     leaf case-1 {
- *         type string;
- *     }
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/main-group/main-group-cont/main-group-cont-choice/a</i>
- *
- */
-public interface A
-    extends
-        TreeNode,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>,
-    MainGroupContChoice
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "a").intern();
-
-    java.lang.String getCase1();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/ABuilder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/ABuilder.java
deleted file mode 100644 (file)
index be5d73a..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import java.util.HashMap;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-import java.util.Collections;
-import java.util.Map;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A
- *
- */
-public class ABuilder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A> {
-
-    private java.lang.String _case1;
-
-    Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>> augmentation = Collections.emptyMap();
-
-    public ABuilder() {
-    }
-
-    public ABuilder(A base) {
-        this._case1 = base.getCase1();
-        if (base instanceof AImpl) {
-            AImpl impl = (AImpl) base;
-            if (!impl.augmentation.isEmpty()) {
-                this.augmentation = new HashMap<>(impl.augmentation);
-            }
-        } else if (base instanceof AugmentationHolder) {
-            @SuppressWarnings("unchecked")
-            AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>) base;
-            if (!casted.augmentations().isEmpty()) {
-                this.augmentation = new HashMap<>(casted.augmentations());
-            }
-        }
-    }
-
-
-    public java.lang.String getCase1() {
-        return _case1;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>> E getAugmentation(java.lang.Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-
-    public ABuilder setCase1(final java.lang.String value) {
-        this._case1 = value;
-        return this;
-    }
-
-    public ABuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A> augmentation) {
-        if (augmentation == null) {
-            return removeAugmentation(augmentationType);
-        }
-
-        if (!(this.augmentation instanceof HashMap)) {
-            this.augmentation = new HashMap<>();
-        }
-
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public ABuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>> augmentationType) {
-        if (this.augmentation instanceof HashMap) {
-            this.augmentation.remove(augmentationType);
-        }
-        return this;
-    }
-
-    public A build() {
-        return new AImpl(this);
-    }
-
-    private static final class AImpl implements A {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A.class;
-        }
-
-        private final java.lang.String _case1;
-
-        private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>> augmentation = Collections.emptyMap();
-
-        private AImpl(ABuilder base) {
-            this._case1 = base.getCase1();
-            switch (base.augmentation.size()) {
-            case 0:
-                this.augmentation = Collections.emptyMap();
-                break;
-            case 1:
-                final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>> e = base.augmentation.entrySet().iterator().next();
-                this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>>singletonMap(e.getKey(), e.getValue());
-                break;
-            default :
-                this.augmentation = new HashMap<>(base.augmentation);
-            }
-        }
-
-        @Override
-        public java.lang.String getCase1() {
-            return _case1;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>> E getAugmentation(java.lang.Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_case1);
-            result = prime * result + Objects.hashCode(augmentation);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A)obj;
-            if (!Objects.equals(_case1, other.getCase1())) {
-                return false;
-            }
-            if (getClass() == obj.getClass()) {
-                // Simple case: we are comparing against self
-                AImpl otherImpl = (AImpl) obj;
-                if (!Objects.equals(augmentation, otherImpl.augmentation)) {
-                    return false;
-                }
-            } else {
-                // Hard case: compare our augments with presence there...
-                for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.A>> e : augmentation.entrySet()) {
-                    if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
-                        return false;
-                    }
-                }
-                // .. and give the other one the chance to do the same
-                if (!obj.equals(this)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("A [");
-            boolean first = true;
-
-            if (_case1 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_case1=");
-                builder.append(_case1);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/B.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/B.java
deleted file mode 100644 (file)
index 71cf1af..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.MainGroupContChoice;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * case b {
- *     leaf case2-1 {
- *         type string;
- *     }
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/main-group/main-group-cont/main-group-cont-choice/b</i>
- *
- */
-public interface B
-    extends
-        TreeNode,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>,
-    MainGroupContChoice
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "b").intern();
-
-    java.lang.String getCase21();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/BBuilder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/main/group/main/group/cont/main/group/cont/choice/BBuilder.java
deleted file mode 100644 (file)
index 988c366..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import java.util.HashMap;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-import java.util.Collections;
-import java.util.Map;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B
- *
- */
-public class BBuilder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B> {
-
-    private java.lang.String _case21;
-
-    Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>> augmentation = Collections.emptyMap();
-
-    public BBuilder() {
-    }
-
-    public BBuilder(B base) {
-        this._case21 = base.getCase21();
-        if (base instanceof BImpl) {
-            BImpl impl = (BImpl) base;
-            if (!impl.augmentation.isEmpty()) {
-                this.augmentation = new HashMap<>(impl.augmentation);
-            }
-        } else if (base instanceof AugmentationHolder) {
-            @SuppressWarnings("unchecked")
-            AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>) base;
-            if (!casted.augmentations().isEmpty()) {
-                this.augmentation = new HashMap<>(casted.augmentations());
-            }
-        }
-    }
-
-
-    public java.lang.String getCase21() {
-        return _case21;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>> E getAugmentation(java.lang.Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-
-    public BBuilder setCase21(final java.lang.String value) {
-        this._case21 = value;
-        return this;
-    }
-
-    public BBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B> augmentation) {
-        if (augmentation == null) {
-            return removeAugmentation(augmentationType);
-        }
-
-        if (!(this.augmentation instanceof HashMap)) {
-            this.augmentation = new HashMap<>();
-        }
-
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public BBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>> augmentationType) {
-        if (this.augmentation instanceof HashMap) {
-            this.augmentation.remove(augmentationType);
-        }
-        return this;
-    }
-
-    public B build() {
-        return new BImpl(this);
-    }
-
-    private static final class BImpl implements B {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B.class;
-        }
-
-        private final java.lang.String _case21;
-
-        private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>> augmentation = Collections.emptyMap();
-
-        private BImpl(BBuilder base) {
-            this._case21 = base.getCase21();
-            switch (base.augmentation.size()) {
-            case 0:
-                this.augmentation = Collections.emptyMap();
-                break;
-            case 1:
-                final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>> e = base.augmentation.entrySet().iterator().next();
-                this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>>singletonMap(e.getKey(), e.getValue());
-                break;
-            default :
-                this.augmentation = new HashMap<>(base.augmentation);
-            }
-        }
-
-        @Override
-        public java.lang.String getCase21() {
-            return _case21;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>> E getAugmentation(java.lang.Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_case21);
-            result = prime * result + Objects.hashCode(augmentation);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B)obj;
-            if (!Objects.equals(_case21, other.getCase21())) {
-                return false;
-            }
-            if (getClass() == obj.getClass()) {
-                // Simple case: we are comparing against self
-                BImpl otherImpl = (BImpl) obj;
-                if (!Objects.equals(augmentation, otherImpl.augmentation)) {
-                    return false;
-                }
-            } else {
-                // Hard case: compare our augments with presence there...
-                for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.main.group.cont.main.group.cont.choice.B>> e : augmentation.entrySet()) {
-                    if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
-                        return false;
-                    }
-                }
-                // .. and give the other one the chance to do the same
-                if (!obj.equals(this)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("B [");
-            boolean first = true;
-
-            if (_case21 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_case21=");
-                builder.append(_case21);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/second/group/SecondGroupCont.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/second/group/SecondGroupCont.java
deleted file mode 100644 (file)
index dcb217f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group;
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.SecondGroup;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTest</b>
- * <pre>
- * container second-group-cont {
- *     leaf second-group-cont-leaf {
- *         type string;
- *     }
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTest/second-group/second-group-cont</i>
- *
- * <p>To create instances of this class use {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupContBuilder}.
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupContBuilder
- *
- */
-public interface SecondGroupCont
-    extends
-        ChildTreeNode<SecondGroup>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTest",
-        "2016-01-01", "second-group-cont").intern();
-
-    java.lang.String getSecondGroupContLeaf();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/second/group/SecondGroupContBuilder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtest/grp/second/group/SecondGroupContBuilder.java
deleted file mode 100644 (file)
index d091098..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import java.util.HashMap;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-import java.util.Collections;
-import java.util.Map;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont
- *
- */
-public class SecondGroupContBuilder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont> {
-
-    private java.lang.String _secondGroupContLeaf;
-
-    Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>> augmentation = Collections.emptyMap();
-
-    public SecondGroupContBuilder() {
-    }
-
-    public SecondGroupContBuilder(SecondGroupCont base) {
-        this._secondGroupContLeaf = base.getSecondGroupContLeaf();
-        if (base instanceof SecondGroupContImpl) {
-            SecondGroupContImpl impl = (SecondGroupContImpl) base;
-            if (!impl.augmentation.isEmpty()) {
-                this.augmentation = new HashMap<>(impl.augmentation);
-            }
-        } else if (base instanceof AugmentationHolder) {
-            @SuppressWarnings("unchecked")
-            AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>) base;
-            if (!casted.augmentations().isEmpty()) {
-                this.augmentation = new HashMap<>(casted.augmentations());
-            }
-        }
-    }
-
-
-    public java.lang.String getSecondGroupContLeaf() {
-        return _secondGroupContLeaf;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>> E getAugmentation(java.lang.Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-
-    public SecondGroupContBuilder setSecondGroupContLeaf(final java.lang.String value) {
-        this._secondGroupContLeaf = value;
-        return this;
-    }
-
-    public SecondGroupContBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont> augmentation) {
-        if (augmentation == null) {
-            return removeAugmentation(augmentationType);
-        }
-
-        if (!(this.augmentation instanceof HashMap)) {
-            this.augmentation = new HashMap<>();
-        }
-
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public SecondGroupContBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>> augmentationType) {
-        if (this.augmentation instanceof HashMap) {
-            this.augmentation.remove(augmentationType);
-        }
-        return this;
-    }
-
-    public SecondGroupCont build() {
-        return new SecondGroupContImpl(this);
-    }
-
-    private static final class SecondGroupContImpl implements SecondGroupCont {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont.class;
-        }
-
-        private final java.lang.String _secondGroupContLeaf;
-
-        private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>> augmentation = Collections.emptyMap();
-
-        private SecondGroupContImpl(SecondGroupContBuilder base) {
-            this._secondGroupContLeaf = base.getSecondGroupContLeaf();
-            switch (base.augmentation.size()) {
-            case 0:
-                this.augmentation = Collections.emptyMap();
-                break;
-            case 1:
-                final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>> e = base.augmentation.entrySet().iterator().next();
-                this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>>singletonMap(e.getKey(), e.getValue());
-                break;
-            default :
-                this.augmentation = new HashMap<>(base.augmentation);
-            }
-        }
-
-        @Override
-        public java.lang.String getSecondGroupContLeaf() {
-            return _secondGroupContLeaf;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>> E getAugmentation(java.lang.Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_secondGroupContLeaf);
-            result = prime * result + Objects.hashCode(augmentation);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont)obj;
-            if (!Objects.equals(_secondGroupContLeaf, other.getSecondGroupContLeaf())) {
-                return false;
-            }
-            if (getClass() == obj.getClass()) {
-                // Simple case: we are comparing against self
-                SecondGroupContImpl otherImpl = (SecondGroupContImpl) obj;
-                if (!Objects.equals(augmentation, otherImpl.augmentation)) {
-                    return false;
-                }
-            } else {
-                // Hard case: compare our augments with presence there...
-                for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.second.group.SecondGroupCont>> e : augmentation.entrySet()) {
-                    if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
-                        return false;
-                    }
-                }
-                // .. and give the other one the chance to do the same
-                if (!obj.equals(this)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("SecondGroupCont [");
-            boolean first = true;
-
-            if (_secondGroupContLeaf != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_secondGroupContLeaf=");
-                builder.append(_secondGroupContLeaf);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/$YangModelBindingProvider.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/$YangModelBindingProvider.java
deleted file mode 100644 (file)
index 57134bb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting;
-
-public final class $YangModelBindingProvider implements org.opendaylight.yangtools.yang.binding.YangModelBindingProvider {
-
-    public org.opendaylight.yangtools.yang.binding.YangModuleInfo getModuleInfo() {
-        return $YangModuleInfoImpl.getInstance();
-    }
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/$YangModuleInfoImpl.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/$YangModuleInfoImpl.java
deleted file mode 100644 (file)
index 9b1fb1a..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import java.util.Set;
-import java.util.HashSet;
-import com.google.common.collect.ImmutableSet;
-import java.io.InputStream;
-import java.io.IOException;
-public final class $YangModuleInfoImpl implements YangModuleInfo {
-
-    private static final YangModuleInfo INSTANCE = new $YangModuleInfoImpl();
-
-    private final String name = "mainYangTestImporting";
-    private final String namespace = "urn:test:mainYangTestImporting";
-    private final String revision = "2016-01-01";
-    private final String resourcePath = "/META-INF/yang/mainYangTestImporting.yang";
-
-    private final Set<YangModuleInfo> importedModules;
-
-    public static YangModuleInfo getInstance() {
-        return INSTANCE;
-    }
-
-    private $YangModuleInfoImpl() {
-        Set<YangModuleInfo> set = new HashSet<>();
-        set.add(org.opendaylight.yang.gen.v1.urn.test.mainyangtest.$YangModuleInfoImpl.getInstance());
-        importedModules = ImmutableSet.copyOf(set);
-
-        InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
-        if (stream == null) {
-            throw new IllegalStateException("Resource '" + resourcePath + "' is missing");
-        }
-        try {
-            stream.close();
-        } catch (IOException e) {
-        // Resource leak, but there is nothing we can do
-        }
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public String getRevision() {
-        return revision;
-    }
-
-    @Override
-    public String getNamespace() {
-        return namespace;
-    }
-
-    @Override
-    public InputStream getModuleSourceStream() throws IOException {
-        InputStream stream = $YangModuleInfoImpl.class.getResourceAsStream(resourcePath);
-        if (stream == null) {
-            throw new IOException("Resource " + resourcePath + " is missing");
-        }
-        return stream;
-    }
-
-    @Override
-    public Set<YangModuleInfo> getImportedModules() {
-        return importedModules;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder(this.getClass().getCanonicalName());
-        sb.append("[");
-        sb.append("name = " + name);
-        sb.append(", namespace = " + namespace);
-        sb.append(", revision = " + revision);
-        sb.append(", resourcePath = " + resourcePath);
-        sb.append(", imports = " + importedModules);
-        sb.append("]");
-        return sb.toString();
-    }
-
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/MainYangTestImportingData.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/MainYangTestImportingData.java
deleted file mode 100644 (file)
index ff8b38d..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer;
-import org.opendaylight.yangtools.yang.binding.TreeRoot;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTestImporting</b>
- * <pre>
- * module mainYangTestImporting {
- *     yang-version 1;
- *     namespace "urn:test:mainYangTestImporting";
- *     prefix "myti";
- *
- *     import mainYangTest { prefix "imp"; }
- *     revision 2016-01-01 {
- *         description "";
- *     }
- *
- *     container importing-container {
- *         container main-group-cont {
- *             leaf main-group-cont-leaf {
- *                 type string;
- *             }
- *             list main-group-cont-list-ordered {
- *                 key "name-1"
- *                 leaf name-1 {
- *                     type string;
- *                 }
- *                 leaf type-1 {
- *                     type string;
- *                 }
- *             }
- *             list main-group-cont-list-unordered {
- *                 key "name-2"
- *                 leaf name-2 {
- *                     type string;
- *                 }
- *                 leaf type-2 {
- *                     type string;
- *                 }
- *             }
- *             choice main-group-cont-choice {
- *                 case a {
- *                     leaf case-1 {
- *                         type string;
- *                     }
- *                 }
- *                 case b {
- *                     leaf case2-1 {
- *                         type string;
- *                     }
- *                 }
- *             }
- *             leaf leaf-ref-test {
- *                 type leafref;
- *             }
- *             container second-group-cont {
- *                 leaf second-group-cont-leaf {
- *                     type string;
- *                 }
- *             }
- *             leaf imported-augmented-leaf-3 {
- *                 type string;
- *             }
- *             augment \(urn:test:mainYangTestImporting)importing-container\(urn:test:mainYangTestImporting)main-group-cont {
- *                 status CURRENT;
- *                 leaf imported-augmented-leaf-3 {
- *                     type string;
- *                 }
- *             }
- *             uses second-group;
- *         }
- *         uses main-group;
- *     }
- *
- *     augment \(urn:test:mainYangTest)main-cont {
- *         status CURRENT;
- *         leaf imported-augmented-leaf-1 {
- *             type string;
- *         }
- *     }
- *     augment \(urn:test:mainYangTest)main-cont {
- *         status CURRENT;
- *         leaf imported-augmented-leaf-2 {
- *             type string;
- *         }
- *     }
- *     augment \(urn:test:mainYangTestImporting)importing-container\(urn:test:mainYangTestImporting)main-group-cont {
- *         status CURRENT;
- *         leaf imported-augmented-leaf-3 {
- *             type string;
- *         }
- *     }
- * }
- * </pre>
- *
- */
-public interface MainYangTestImportingData
-    extends
-        TreeRoot
-{
-
-
-
-
-    ImportingContainer getImportingContainer();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/ImportingContainer.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/ImportingContainer.java
deleted file mode 100644 (file)
index c43661f..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data;
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.MainYangTestImportingData;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-
-
-/**
- * <p>This class represents the following YANG schema fragment defined in module <b>mainYangTestImporting</b>
- * <pre>
- * container importing-container {
- *     container main-group-cont {
- *         leaf main-group-cont-leaf {
- *             type string;
- *         }
- *         list main-group-cont-list-ordered {
- *             key "name-1"
- *             leaf name-1 {
- *                 type string;
- *             }
- *             leaf type-1 {
- *                 type string;
- *             }
- *         }
- *         list main-group-cont-list-unordered {
- *             key "name-2"
- *             leaf name-2 {
- *                 type string;
- *             }
- *             leaf type-2 {
- *                 type string;
- *             }
- *         }
- *         choice main-group-cont-choice {
- *             case a {
- *                 leaf case-1 {
- *                     type string;
- *                 }
- *             }
- *             case b {
- *                 leaf case2-1 {
- *                     type string;
- *                 }
- *             }
- *         }
- *         leaf leaf-ref-test {
- *             type leafref;
- *         }
- *         container second-group-cont {
- *             leaf second-group-cont-leaf {
- *                 type string;
- *             }
- *         }
- *         leaf imported-augmented-leaf-3 {
- *             type string;
- *         }
- *         augment \(urn:test:mainYangTestImporting)importing-container\(urn:test:mainYangTestImporting)main-group-cont {
- *             status CURRENT;
- *             leaf imported-augmented-leaf-3 {
- *                 type string;
- *             }
- *         }
- *         uses second-group;
- *     }
- *     uses main-group;
- * }
- * </pre>
- * The schema path to identify an instance is
- * <i>mainYangTestImporting/importing-container</i>
- *
- * <p>To create instances of this class use {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainerBuilder}.
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainerBuilder
- *
- */
-public interface ImportingContainer
-    extends
-        ChildTreeNode<MainYangTestImportingData>,
-    Augmentable<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>,
-    MainGroup
-{
-
-
-
-    public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:test:mainYangTestImporting",
-        "2016-01-01", "importing-container").intern();
-
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/ImportingContainerBuilder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/ImportingContainerBuilder.java
deleted file mode 100644 (file)
index 94ddd49..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import java.util.HashMap;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-import java.util.Collections;
-import java.util.Map;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer
- *
- */
-public class ImportingContainerBuilder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer> {
-
-    private MainGroupCont _mainGroupCont;
-
-    Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>> augmentation = Collections.emptyMap();
-
-    public ImportingContainerBuilder() {
-    }
-    public ImportingContainerBuilder(org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup arg) {
-        this._mainGroupCont = arg.getMainGroupCont();
-    }
-
-    public ImportingContainerBuilder(ImportingContainer base) {
-        this._mainGroupCont = base.getMainGroupCont();
-        if (base instanceof ImportingContainerImpl) {
-            ImportingContainerImpl impl = (ImportingContainerImpl) base;
-            if (!impl.augmentation.isEmpty()) {
-                this.augmentation = new HashMap<>(impl.augmentation);
-            }
-        } else if (base instanceof AugmentationHolder) {
-            @SuppressWarnings("unchecked")
-            AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>) base;
-            if (!casted.augmentations().isEmpty()) {
-                this.augmentation = new HashMap<>(casted.augmentations());
-            }
-        }
-    }
-
-    /**
-     *Set fields from given grouping argument. Valid argument is instance of one of following types:
-     * <ul>
-     * <li>org.opendaylight.yang.gen.v1.urn.test.mainyangtest.rev160101.MainGroup</li>
-     * </ul>
-     *
-     * @param arg grouping object
-     * @throws IllegalArgumentException if given argument is none of valid types
-    */
-    public void fieldsFrom(TreeNode arg) {
-        boolean isValidArg = false;
-        if (arg instanceof org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup) {
-            this._mainGroupCont = ((org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.MainGroup)arg).getMainGroupCont();
-            isValidArg = true;
-        }
-        if (!isValidArg) {
-            throw new IllegalArgumentException(
-              "expected one of: [org.opendaylight.yang.gen.v1.urn.test.mainyangtest.rev160101.MainGroup] \n" +
-              "but was: " + arg
-            );
-        }
-    }
-
-    public MainGroupCont getMainGroupCont() {
-        return _mainGroupCont;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>> E getAugmentation(java.lang.Class<E> augmentationType) {
-        if (augmentationType == null) {
-            throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-        }
-        return (E) augmentation.get(augmentationType);
-    }
-
-
-    public ImportingContainerBuilder setMainGroupCont(final MainGroupCont value) {
-        this._mainGroupCont = value;
-        return this;
-    }
-
-    public ImportingContainerBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer> augmentation) {
-        if (augmentation == null) {
-            return removeAugmentation(augmentationType);
-        }
-
-        if (!(this.augmentation instanceof HashMap)) {
-            this.augmentation = new HashMap<>();
-        }
-
-        this.augmentation.put(augmentationType, augmentation);
-        return this;
-    }
-
-    public ImportingContainerBuilder removeAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>> augmentationType) {
-        if (this.augmentation instanceof HashMap) {
-            this.augmentation.remove(augmentationType);
-        }
-        return this;
-    }
-
-    public ImportingContainer build() {
-        return new ImportingContainerImpl(this);
-    }
-
-    private static final class ImportingContainerImpl implements ImportingContainer {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer.class;
-        }
-
-        private final MainGroupCont _mainGroupCont;
-
-        private Map<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>> augmentation = Collections.emptyMap();
-
-        private ImportingContainerImpl(ImportingContainerBuilder base) {
-            this._mainGroupCont = base.getMainGroupCont();
-            switch (base.augmentation.size()) {
-            case 0:
-                this.augmentation = Collections.emptyMap();
-                break;
-            case 1:
-                final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>> e = base.augmentation.entrySet().iterator().next();
-                this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>>singletonMap(e.getKey(), e.getValue());
-                break;
-            default :
-                this.augmentation = new HashMap<>(base.augmentation);
-            }
-        }
-
-        @Override
-        public MainGroupCont getMainGroupCont() {
-            return _mainGroupCont;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>> E getAugmentation(java.lang.Class<E> augmentationType) {
-            if (augmentationType == null) {
-                throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
-            }
-            return (E) augmentation.get(augmentationType);
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_mainGroupCont);
-            result = prime * result + Objects.hashCode(augmentation);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer)obj;
-            if (!Objects.equals(_mainGroupCont, other.getMainGroupCont())) {
-                return false;
-            }
-            if (getClass() == obj.getClass()) {
-                // Simple case: we are comparing against self
-                ImportingContainerImpl otherImpl = (ImportingContainerImpl) obj;
-                if (!Objects.equals(augmentation, otherImpl.augmentation)) {
-                    return false;
-                }
-            } else {
-                // Hard case: compare our augments with presence there...
-                for (Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>>, Augmentation<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.ImportingContainer>> e : augmentation.entrySet()) {
-                    if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
-                        return false;
-                    }
-                }
-                // .. and give the other one the chance to do the same
-                if (!obj.equals(this)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("ImportingContainer [");
-            boolean first = true;
-
-            if (_mainGroupCont != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_mainGroupCont=");
-                builder.append(_mainGroupCont);
-             }
-            if (first) {
-                first = false;
-            } else {
-                builder.append(", ");
-            }
-            builder.append("augmentation=");
-            builder.append(augmentation.values());
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont1.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont1.java
deleted file mode 100644 (file)
index 4d101e3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-
-
-public interface MainCont1
-    extends
-        TreeNode,
-    Augmentation<MainCont>
-{
-
-
-
-
-    java.lang.String getImportedAugmentedLeaf1();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont1Builder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont1Builder.java
deleted file mode 100644 (file)
index 9399ac7..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont1} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont1
- *
- */
-public class MainCont1Builder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont1> {
-
-    private java.lang.String _importedAugmentedLeaf1;
-
-
-    public MainCont1Builder() {
-    }
-
-    public MainCont1Builder(MainCont1 base) {
-        this._importedAugmentedLeaf1 = base.getImportedAugmentedLeaf1();
-    }
-
-
-    public java.lang.String getImportedAugmentedLeaf1() {
-        return _importedAugmentedLeaf1;
-    }
-
-
-    public MainCont1Builder setImportedAugmentedLeaf1(final java.lang.String value) {
-        this._importedAugmentedLeaf1 = value;
-        return this;
-    }
-
-    public MainCont1 build() {
-        return new MainCont1Impl(this);
-    }
-
-    private static final class MainCont1Impl implements MainCont1 {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont1> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont1.class;
-        }
-
-        private final java.lang.String _importedAugmentedLeaf1;
-
-
-        private MainCont1Impl(MainCont1Builder base) {
-            this._importedAugmentedLeaf1 = base.getImportedAugmentedLeaf1();
-        }
-
-        @Override
-        public java.lang.String getImportedAugmentedLeaf1() {
-            return _importedAugmentedLeaf1;
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_importedAugmentedLeaf1);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont1.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont1 other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont1)obj;
-            if (!Objects.equals(_importedAugmentedLeaf1, other.getImportedAugmentedLeaf1())) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("MainCont1 [");
-            boolean first = true;
-
-            if (_importedAugmentedLeaf1 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_importedAugmentedLeaf1=");
-                builder.append(_importedAugmentedLeaf1);
-             }
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont2.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont2.java
deleted file mode 100644 (file)
index c0f5b81..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.data.MainCont;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-
-
-public interface MainCont2
-    extends
-        TreeNode,
-    Augmentation<MainCont>
-{
-
-
-
-
-    java.lang.String getImportedAugmentedLeaf2();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont2Builder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainCont2Builder.java
deleted file mode 100644 (file)
index e41c7b9..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont2} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont2
- *
- */
-public class MainCont2Builder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont2> {
-
-    private java.lang.String _importedAugmentedLeaf2;
-
-
-    public MainCont2Builder() {
-    }
-
-    public MainCont2Builder(MainCont2 base) {
-        this._importedAugmentedLeaf2 = base.getImportedAugmentedLeaf2();
-    }
-
-
-    public java.lang.String getImportedAugmentedLeaf2() {
-        return _importedAugmentedLeaf2;
-    }
-
-
-    public MainCont2Builder setImportedAugmentedLeaf2(final java.lang.String value) {
-        this._importedAugmentedLeaf2 = value;
-        return this;
-    }
-
-    public MainCont2 build() {
-        return new MainCont2Impl(this);
-    }
-
-    private static final class MainCont2Impl implements MainCont2 {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont2> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont2.class;
-        }
-
-        private final java.lang.String _importedAugmentedLeaf2;
-
-
-        private MainCont2Impl(MainCont2Builder base) {
-            this._importedAugmentedLeaf2 = base.getImportedAugmentedLeaf2();
-        }
-
-        @Override
-        public java.lang.String getImportedAugmentedLeaf2() {
-            return _importedAugmentedLeaf2;
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_importedAugmentedLeaf2);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont2.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont2 other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainCont2)obj;
-            if (!Objects.equals(_importedAugmentedLeaf2, other.getImportedAugmentedLeaf2())) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("MainCont2 [");
-            boolean first = true;
-
-            if (_importedAugmentedLeaf2 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_importedAugmentedLeaf2=");
-                builder.append(_importedAugmentedLeaf2);
-             }
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainGroupCont1.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainGroupCont1.java
deleted file mode 100644 (file)
index d71ccaa..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data;
-import org.opendaylight.yang.gen.v1.urn.test.mainyangtest.grp.main.group.MainGroupCont;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-
-
-public interface MainGroupCont1
-    extends
-        TreeNode,
-    Augmentation<MainGroupCont>
-{
-
-
-
-
-    java.lang.String getImportedAugmentedLeaf3();
-
-}
-
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainGroupCont1Builder.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/data/MainGroupCont1Builder.java
deleted file mode 100644 (file)
index 842a309..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.concepts.Builder;
-import java.util.Objects;
-
-
-/**
- * Class that builds {@link org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainGroupCont1} instances.
- *
- * @see org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainGroupCont1
- *
- */
-public class MainGroupCont1Builder implements Builder <org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainGroupCont1> {
-
-    private java.lang.String _importedAugmentedLeaf3;
-
-
-    public MainGroupCont1Builder() {
-    }
-
-    public MainGroupCont1Builder(MainGroupCont1 base) {
-        this._importedAugmentedLeaf3 = base.getImportedAugmentedLeaf3();
-    }
-
-
-    public java.lang.String getImportedAugmentedLeaf3() {
-        return _importedAugmentedLeaf3;
-    }
-
-
-    public MainGroupCont1Builder setImportedAugmentedLeaf3(final java.lang.String value) {
-        this._importedAugmentedLeaf3 = value;
-        return this;
-    }
-
-    public MainGroupCont1 build() {
-        return new MainGroupCont1Impl(this);
-    }
-
-    private static final class MainGroupCont1Impl implements MainGroupCont1 {
-
-        public java.lang.Class<org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainGroupCont1> implementedInterface() {
-            return org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainGroupCont1.class;
-        }
-
-        private final java.lang.String _importedAugmentedLeaf3;
-
-
-        private MainGroupCont1Impl(MainGroupCont1Builder base) {
-            this._importedAugmentedLeaf3 = base.getImportedAugmentedLeaf3();
-        }
-
-        @Override
-        public java.lang.String getImportedAugmentedLeaf3() {
-            return _importedAugmentedLeaf3;
-        }
-
-        private int hash = 0;
-        private volatile boolean hashValid = false;
-
-        @Override
-        public int hashCode() {
-            if (hashValid) {
-                return hash;
-            }
-
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + Objects.hashCode(_importedAugmentedLeaf3);
-
-            hash = result;
-            hashValid = true;
-            return result;
-        }
-
-        @Override
-        public boolean equals(java.lang.Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (!(obj instanceof TreeNode)) {
-                return false;
-            }
-            if (!org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainGroupCont1.class.equals(((TreeNode)obj).implementedInterface())) {
-                return false;
-            }
-            org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainGroupCont1 other = (org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting.data.MainGroupCont1)obj;
-            if (!Objects.equals(_importedAugmentedLeaf3, other.getImportedAugmentedLeaf3())) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public java.lang.String toString() {
-            java.lang.StringBuilder builder = new java.lang.StringBuilder ("MainGroupCont1 [");
-            boolean first = true;
-
-            if (_importedAugmentedLeaf3 != null) {
-                if (first) {
-                    first = false;
-                } else {
-                    builder.append(", ");
-                }
-                builder.append("_importedAugmentedLeaf3=");
-                builder.append(_importedAugmentedLeaf3);
-             }
-            return builder.append(']').toString();
-        }
-    }
-
-}
diff --git a/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/package-info.java b/binding2/prototype/src/test/java/org/opendaylight/yang/gen/v1/urn/test/mainyangtestimporting/package-info.java
deleted file mode 100644 (file)
index edb83a9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- *
- */
-
-/**
- * @author tony
- *
- */
-package org.opendaylight.yang.gen.v1.urn.test.mainyangtestimporting;
diff --git a/binding2/prototype/yang-binding2/pom.xml b/binding2/prototype/yang-binding2/pom.xml
deleted file mode 100644 (file)
index a6e2400..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
- Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
-
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 which accompanies this distribution,
- and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-    <parent>
-        <groupId>org.opendaylight.mdsal</groupId>
-        <artifactId>mdsal-binding</artifactId>
-        <version>0.15.0-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>yang-binding2</artifactId>
-    <name>${project.artifactId}</name>
-    <description>Java binding for YANG</description>
-    <packaging>bundle</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>concepts</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>util</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-common</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentable.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentable.java
deleted file mode 100644 (file)
index 8a6d648..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * Augmentable (extensible) object which could carry additional data defined by
- * third-party extension, without introducing conflict between various
- * extension.
- *
- * This interface uses extended version of ExtensibleInterface pattern which
- * also adds marker interface for augmentations (extensions) -
- * {@link Augmentable}
- *
- * @author Tony Tkacik
- * @param <T>
- *            Base class which should implements this interface and is target
- *            for augmentation.
- */
-public interface Augmentable<T> {
-
-    /**
-     * Returns instance of augmentation.
-     *
-     * @param augmentationType
-     *            Type of augmentation to be returned.
-     * @return instance of augmentation.
-     */
-    <E extends Augmentation<T>> E getAugmentation(Class<E> augmentationType);
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentation.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentation.java
deleted file mode 100644 (file)
index cf10912..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * Augmentation (extension) of other interface.
- *
- * This interface uniquely bounds Augmentation to generated
- * interface.
- *
- * All interfaces generated from YANG Augmentation statement
- * must implement this interface with parameter <code>P</code>
- * which uniquely points to it's target class.
- *
- *
- *
- * @param <T> Class to which this implementation is extension.
- */
-public interface Augmentation<T> {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/AugmentationHolder.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/AugmentationHolder.java
deleted file mode 100644 (file)
index 9dc76eb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import java.util.Map;
-
-/**
- *
- * Augmentable (extensible) object which could carry additional data defined by
- * third-party extension, without introducing conflict between various
- * extension.
- *
- *
- * @author Tony Tkacik
- * @param <T>
- *            Base class which should is target
- *            for augmentations.
- */
-public interface AugmentationHolder<T> {
-
-    /**
-     * Returns map of all augmentations.
-     *
-     * @return map of all augmentations.
-     */
-    Map<Class<? extends Augmentation<T>>,Augmentation<T>> augmentations();
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BaseIdentity.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BaseIdentity.java
deleted file mode 100644 (file)
index 9ae1f22..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * Base Identity
- *
- */
-public abstract class BaseIdentity {
-
-    public final static BaseIdentity INSTANCE = new BaseIdentity() {
-    };
-
-    protected BaseIdentity() {
-
-    }
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingCodec.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingCodec.java
deleted file mode 100644 (file)
index 48e65e1..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import org.opendaylight.yangtools.concepts.Codec;
-
-public interface BindingCodec<P, I> extends BindingSerializer<P, I>, BindingDeserializer<I, P>, Codec<P, I> {
-
-    @Override
-    P serialize(I input);
-
-    @Override
-    I deserialize(P input);
-
-    I deserialize(P input, InstanceIdentifier<?> bindingIdentifier);
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingDeserializer.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingDeserializer.java
deleted file mode 100644 (file)
index 7165291..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-public interface BindingDeserializer<P,I> {
-
-    P deserialize(I input);
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingMapping.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingMapping.java
deleted file mode 100644 (file)
index 39cf375..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import com.google.common.base.CharMatcher;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Interner;
-import com.google.common.collect.Interners;
-import java.text.SimpleDateFormat;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-
-public final class BindingMapping {
-
-    public static final String VERSION = "0.6";
-
-    public static final Set<String> JAVA_RESERVED_WORDS = ImmutableSet.of("abstract", "assert", "boolean", "break",
-            "byte", "case", "catch", "char", "class", "const", "continue", "default", "double", "do", "else", "enum",
-            "extends", "false", "final", "finally", "float", "for", "goto", "if", "implements", "import", "instanceof",
-            "int", "interface", "long", "native", "new", "null", "package", "private", "protected", "public", "return",
-            "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient",
-            "true", "try", "void", "volatile", "while");
-
-    public static final String DATA_ROOT_SUFFIX = "Data";
-    public static final String RPC_SERVICE_SUFFIX = "Service";
-    public static final String NOTIFICATION_LISTENER_SUFFIX = "Listener";
-    public static final String QNAME_STATIC_FIELD_NAME = "QNAME";
-    public static final String PACKAGE_PREFIX = "org.opendaylight.yang.gen.v1";
-    public static final String AUGMENTATION_FIELD = "augmentation";
-
-    private static final Splitter CAMEL_SPLITTER = Splitter.on(CharMatcher.anyOf(" _.-").precomputed())
-            .omitEmptyStrings().trimResults();
-    private static final Pattern COLON_SLASH_SLASH = Pattern.compile("://", Pattern.LITERAL);
-    private static final String QUOTED_DOT = Matcher.quoteReplacement(".");
-    private static final Splitter DOT_SPLITTER = Splitter.on('.');
-
-    public static final String MODULE_INFO_CLASS_NAME = "$YangModuleInfoImpl";
-    public static final String MODEL_BINDING_PROVIDER_CLASS_NAME = "$YangModelBindingProvider";
-
-    public static final String RPC_INPUT_SUFFIX = "Input";
-    public static final String RPC_OUTPUT_SUFFIX = "Output";
-
-    private static final ThreadLocal<SimpleDateFormat> PACKAGE_DATE_FORMAT = new ThreadLocal<SimpleDateFormat>() {
-
-        @Override
-        protected SimpleDateFormat initialValue() {
-            return new SimpleDateFormat("yyMMdd");
-        }
-
-        @Override
-        public void set(final SimpleDateFormat value) {
-            throw new UnsupportedOperationException();
-        }
-    };
-
-    private static final Interner<String> PACKAGE_INTERNER = Interners.newWeakInterner();
-
-    private BindingMapping() {
-        throw new UnsupportedOperationException("Utility class should not be instantiated");
-    }
-
-    public static String getRootPackageName(final QName module) {
-        return getRootPackageName(module.getModule());
-    }
-
-    public static String getRootPackageName(final QNameModule module) {
-        checkArgument(module != null, "Module must not be null");
-        checkArgument(module.getRevision() != null, "Revision must not be null");
-        checkArgument(module.getNamespace() != null, "Namespace must not be null");
-        final StringBuilder packageNameBuilder = new StringBuilder();
-
-        packageNameBuilder.append(BindingMapping.PACKAGE_PREFIX);
-        packageNameBuilder.append('.');
-
-        String namespace = module.getNamespace().toString();
-        namespace = COLON_SLASH_SLASH.matcher(namespace).replaceAll(QUOTED_DOT);
-
-        final char[] chars = namespace.toCharArray();
-        for (int i = 0; i < chars.length; ++i) {
-            switch (chars[i]) {
-            case '/':
-            case ':':
-            case '-':
-            case '@':
-            case '$':
-            case '#':
-            case '\'':
-            case '*':
-            case '+':
-            case ',':
-            case ';':
-            case '=':
-                chars[i] = '.';
-            }
-        }
-
-        packageNameBuilder.append(chars);
-        packageNameBuilder.append(".rev");
-        packageNameBuilder.append(PACKAGE_DATE_FORMAT.get().format(module.getRevision()));
-        return normalizePackageName(packageNameBuilder.toString());
-    }
-
-    public static String normalizePackageName(final String packageName) {
-        if (packageName == null) {
-            return null;
-        }
-
-        final StringBuilder builder = new StringBuilder();
-        boolean first = true;
-
-        for (String p : DOT_SPLITTER.split(packageName.toLowerCase())) {
-            if (first) {
-                first = false;
-            } else {
-                builder.append('.');
-            }
-
-            if (Character.isDigit(p.charAt(0)) || BindingMapping.JAVA_RESERVED_WORDS.contains(p)) {
-                builder.append('_');
-            }
-            builder.append(p);
-        }
-
-        // Prevent duplication of input string
-        return PACKAGE_INTERNER.intern(builder.toString());
-    }
-
-    public static String getMethodName(final QName name) {
-        checkArgument(name != null, "Name should not be null.");
-        return getMethodName(name.getLocalName());
-    }
-
-    public static String getClassName(final String localName) {
-        checkArgument(localName != null, "Name should not be null.");
-        return toFirstUpper(toCamelCase(localName));
-    }
-
-    public static String getMethodName(final String yangIdentifier) {
-        checkArgument(yangIdentifier != null,"Identifier should not be null");
-        return toFirstLower(toCamelCase(yangIdentifier));
-    }
-
-    public static String getClassName(final QName name) {
-        checkArgument(name != null, "Name should not be null.");
-        return toFirstUpper(toCamelCase(name.getLocalName()));
-    }
-
-    public static String getGetterSuffix(final QName name) {
-        checkArgument(name != null, "Name should not be null.");
-        final String candidate = toFirstUpper(toCamelCase(name.getLocalName()));
-        return ("Class".equals(candidate) ? "XmlClass" : candidate);
-    }
-
-    public static String getPropertyName(final String yangIdentifier) {
-        final String potential = toFirstLower(toCamelCase(yangIdentifier));
-        if ("class".equals(potential)) {
-            return "xmlClass";
-        }
-        return potential;
-    }
-
-    private static String toCamelCase(final String rawString) {
-        checkArgument(rawString != null, "String should not be null");
-        Iterable<String> components = CAMEL_SPLITTER.split(rawString);
-        StringBuilder builder = new StringBuilder();
-        for (String comp : components) {
-            builder.append(toFirstUpper(comp));
-        }
-        return checkNumericPrefix(builder.toString());
-    }
-
-    private static String checkNumericPrefix(final String rawString) {
-        if (rawString == null || rawString.isEmpty()) {
-            return rawString;
-        }
-        char firstChar = rawString.charAt(0);
-        if (firstChar >= '0' && firstChar <= '9') {
-            return "_" + rawString;
-        } else {
-            return rawString;
-        }
-    }
-
-    /**
-     * Returns the {@link String} {@code s} with an
-     * {@link Character#isUpperCase(char) upper case} first character. This
-     * function is null-safe.
-     *
-     * @param s
-     *            the string that should get an upper case first character. May
-     *            be <code>null</code>.
-     * @return the {@link String} {@code s} with an upper case first character
-     *         or <code>null</code> if the input {@link String} {@code s} was
-     *         <code>null</code>.
-     */
-    public static String toFirstUpper(final String s) {
-        if (s == null || s.length() == 0) {
-            return s;
-        }
-        if (Character.isUpperCase(s.charAt(0))) {
-            return s;
-        }
-        if (s.length() == 1) {
-            return s.toUpperCase();
-        }
-        return s.substring(0, 1).toUpperCase() + s.substring(1);
-    }
-
-    /**
-     * Returns the {@link String} {@code s} with an
-     * {@link Character#isLowerCase(char) lower case} first character. This
-     * function is null-safe.
-     *
-     * @param s
-     *            the string that should get an lower case first character. May
-     *            be <code>null</code>.
-     * @return the {@link String} {@code s} with an lower case first character
-     *         or <code>null</code> if the input {@link String} {@code s} was
-     *         <code>null</code>.
-     */
-    private static String toFirstLower(final String s) {
-        if (s == null || s.length() == 0) {
-            return s;
-        }
-        if (Character.isLowerCase(s.charAt(0))) {
-            return s;
-        }
-        if (s.length() == 1) {
-            return s.toLowerCase();
-        }
-        return s.substring(0, 1).toLowerCase() + s.substring(1);
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingSerializer.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingSerializer.java
deleted file mode 100644 (file)
index a8a66b7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-public interface BindingSerializer<P,I> {
-    P serialize(I input);
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingStreamEventWriter.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/BindingStreamEventWriter.java
deleted file mode 100644 (file)
index 811dc71..0000000
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import java.io.Closeable;
-import java.io.Flushable;
-import java.io.IOException;
-
-
-/**
- * Event Stream Writer for Binding Representation
- *
- *
- * <h3>Emmiting Event Stream</h3>
- *
- * <ul>
- * <li><code>container</code> - Container node representation, start event is
- * emitted using {@link #startContainerNode(Class, int)} and node end event is
- * emitted using {@link #endNode()}. Container node is implementing
- * {@link TreeNode} interface.
- *
- * <li><code>list</code> - YANG list statement has two representation in event
- * stream - unkeyed list and map. Unkeyed list is YANG list which did not
- * specify key.
- *
- * <ul>
- * <li><code>Map</code> - Map start event is emitted using
- * {@link #startMapNode(Class, int)} and is ended using {@link #endNode()}. Each map
- * entry start is emitted using {@link #startMapEntryNode(Identifier, int)} with Map of keys
- * and finished using {@link #endNode()}.</li>
- *
- * <li><code>UnkeyedList</code> - Unkeyed list represent list without keys,
- * unkeyed list start is emitted using {@link #startUnkeyedList(Class, int)} list
- * end is emitted using {@link #endNode()}. Each list item is emitted using
- * {@link #startUnkeyedListItem(int)} and ended using {@link #endNode()}.</li>
- * </ul></li>
- *
- * <li><code>leaf</code> - Leaf node event is emitted using
- * {@link #leafNode(String, Object)}. {@link #endNode()} MUST be not emitted for
- * leaf node.</li>
- *
- * <li><code>leaf-list</code> - Leaf list start is emitted using
- * {@link #startLeafSet(String, int)}. Leaf list end is emitted using
- * {@link #endNode()}. Leaf list entries are emitted using
- * {@link #leafSetEntryNode(Object)}.
- *
- * <li><code>anyxml - Anyxml node event is emitted using
- * {@link #leafNode(String, Object)}. {@link #endNode()} MUST be not emitted
- * for anyxml node.</code></li>
- *
- *
- * <li><code>choice</code> Choice node event is emitted by
- * {@link #startChoiceNode(Class, int)} event and must be immediately followed by
- * {@link #startCase(Class, int)} event. Choice node is finished by emitting an
- * {@link #endNode()} event.</li>
- *
- * <li>
- * <code>case</code> - Case node may be emitted only inside choice node by
- * invoking {@link #startCase(Class, int)}. Case node is finished be emitting an
- * {@link #endNode()} event.</li>
- *
- * <li>
- * <code>augment</code> - Represents augmentation, augmentation node is started
- * by invoking {@link #startAugmentationNode(Class)} and
- * finished by invoking {@link #endNode()}.</li>
- *
- * </ul>
- *
- * <h3>Implementation notes</h3> This interface is not intended to be
- * implemented by users of generated Binding DTOs but to be used by utilities,
- * which needs to emit NormalizedNode model from Binding DTOs.
- * <p>
- * This interface is intended as API definition of facade for real Event /
- * Stream Writer, without explicitly requiring stream writer and related
- * interfaces to be imported by all generated Binding DTOs.
- * <p>
- * Existence of this interface in base Java Binding package is required to
- * support runtime generation of users of this interface in OSGI and OSGI-like
- * environment, since this package is only package which is imported by all
- * generated Binding DTOs and wired in OSGI.
- *
- *
- */
-public interface BindingStreamEventWriter extends Closeable, Flushable {
-
-    /**
-     * Methods in this interface allow users to hint the underlying
-     * implementation about the sizing of container-like constructors
-     * (leafLists, containers, etc.). These hints may be taken into account by a
-     * particular implementation to improve performance, but clients are not
-     * required to provide hints. This constant should be used by clients who
-     * either do not have the sizing information, or do not wish to divulge it
-     * (for whatever reasons). Implementations are free to ignore these hints
-     * completely, but if they do use them, they are expected to be resilient in
-     * face of missing and mismatched hints, which is to say the user can
-     * specify startLeafSet(..., 1) and then call leafNode() 15 times.
-     * <p>
-     * The acceptable hint values are non-negative integers and this constant,
-     * all other values will result, based on implementation preference, in the
-     * hint being completely ignored or IllegalArgumentException being thrown.
-     */
-    int UNKNOWN_SIZE = -1;
-
-    /**
-     *
-     * Emits a leaf node event with supplied value.
-     *
-     * @param localName
-     *            name of node as defined in schema, namespace and revision are
-     *            derived from parent node.
-     * @param value
-     *            Value of leaf node.
-     * @throws IllegalArgumentException
-     *             If emitted leaf node has invalid value in current context or
-     *             was emitted multiple times.
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>,
-     *             <code>choice</code> <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void leafNode(String localName, Object value) throws IOException, IllegalArgumentException;
-
-    /**
-     *
-     * Emits a start of leaf set (leaf-list).
-     * <p>
-     * Emits start of leaf set, during writing leaf set event, only
-     * {@link #leafSetEntryNode(Object)} calls are valid. Leaf set event is
-     * finished by calling {@link #endNode()}.
-     *
-     * @param localName
-     *            name of node as defined in schema, namespace and revision are
-     *            derived from parent node.
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalArgumentException
-     *             If emitted leaf node is invalid in current context or was
-     *             emitted multiple times.
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>,
-     *             <code>choice</code> <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startLeafSet(String localName, int childSizeHint) throws IOException, IllegalArgumentException;
-
-    /**
-     *
-     * Emits a start of leaf set (leaf-list).
-     * <p>
-     * Emits start of leaf set, during writing leaf set event, only
-     * {@link #leafSetEntryNode(Object)} calls are valid. Leaf set event is
-     * finished by calling {@link #endNode()}.
-     *
-     * @param localName
-     *            name of node as defined in schema, namespace and revision are
-     *            derived from parent node.
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalArgumentException
-     *             If emitted leaf node is invalid in current context or was
-     *             emitted multiple times.
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>,
-     *             <code>choice</code> <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startOrderedLeafSet(String localName, int childSizeHint) throws IOException, IllegalArgumentException;
-
-    /**
-     * Emits a leaf set entry node
-     *
-     * @param value
-     *            Value of leaf set entry node.
-     * @throws IllegalArgumentException
-     *             If emitted leaf node has invalid value.
-     * @throws IllegalStateException
-     *             If node was emitted outside <code>leaf set</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void leafSetEntryNode(Object value) throws IOException, IllegalArgumentException;
-
-    /**
-     *
-     * Emits start of new container.
-     *
-     * <p>
-     * End of container event is emitted by invoking {@link #endNode()}.
-     *
-     * <p>
-     * Valid sub-events are:
-     * <ul>
-     * <li>{@link #leafNode(String, Object)}</li>
-     * <li>{@link #startContainerNode(Class, int)}</li>
-     * <li>{@link #startChoiceNode(Class, int)}</li>
-     * <li>{@link #startLeafSet(String, int)}</li>
-     * <li>{@link #startMapNode(Class, int)}</li>
-     * <li>{@link #startUnkeyedList(Class, int)}</li>
-     * <li>{@link #startAugmentationNode(Class)}</li>
-     * </ul>
-     *
-     * @param container
-     *            name of node as defined in schema, namespace and revision are
-     *            derived from parent node.
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalArgumentException
-     *             If emitted node is invalid in current context or was emitted
-     *             multiple times.
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>,
-     *             <code>choice</code> <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startContainerNode(Class<? extends TreeNode> container, int childSizeHint) throws IOException, IllegalArgumentException;
-
-    /**
-     *
-     * Emits start of unkeyed list node event.
-     *
-     * <p>
-     * End of unkeyed list event is emitted by invoking {@link #endNode()}.
-     * Valid subevents is only {@link #startUnkeyedListItem(int)}. All other
-     * methods will throw {@link IllegalArgumentException}.
-     *
-     * @param localName
-     *            name of node as defined in schema, namespace and revision are
-     *            derived from parent node.
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalArgumentException
-     *             If emitted node is invalid in current context or was emitted
-     *             multiple times.
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>,
-     *             <code>choice</code> <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startUnkeyedList(Class<? extends TreeNode> localName, int childSizeHint) throws IOException, IllegalArgumentException;
-
-    /**
-     * Emits start of new unkeyed list item.
-     *
-     * <p>
-     * Unkeyed list item event is finished by invoking {@link #endNode()}. Valid
-     * sub-events are:
-     * <p>
-     * Valid sub-events are:
-     *
-     * <ul>
-     * <li>{@link #leafNode(String, Object)}</li>
-     * <li>{@link #startContainerNode(Class, int)}</li>
-     * <li>{@link #startChoiceNode(Class, int)}</li>
-     * <li>{@link #startLeafSet(String, int)}</li>
-     * <li>{@link #startMapNode(Class, int)}</li>
-     * <li>{@link #startUnkeyedList(Class, int)}</li>
-     * <li>{@link #startAugmentationNode(Class)}</li>
-     * </ul>
-     *
-     *
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalStateException
-     *             If node was emitted outside <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startUnkeyedListItem(int childSizeHint) throws IOException, IllegalStateException;
-
-    /**
-     *
-     * Emits start of unordered map node event.
-     *
-     * <p>
-     * End of map node event is emitted by invoking {@link #endNode()}. Valid
-     * subevents is only {@link #startMapEntryNode(Identifier, int)}. All other methods will
-     * throw {@link IllegalArgumentException}.
-     *
-     * @param mapEntryType
-     *            Class of list item, which has defined key.
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalArgumentException
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>,
-     *             <code>choice</code> <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    <T extends TreeNode & IdentifiableListItem<?>> void startMapNode(Class<T> mapEntryType, int childSizeHint)
-            throws IOException, IllegalArgumentException;
-
-    /**
-     *
-     * Emits start of ordered map node event.
-     *
-     * <p>
-     * End of map node event is emitted by invoking {@link #endNode()}. Valid
-     * subevents is only {@link #startMapEntryNode(Identifier, int)}. All other methods will
-     * throw {@link IllegalArgumentException}.
-     *
-     * @param mapEntryType
-     *            Class of list item, which has defined key.
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalArgumentException
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>,
-     *             <code>choice</code> <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    <T extends TreeNode & IdentifiableListItem<?>> void startOrderedMapNode(Class<T> mapEntryType, int childSizeHint)
-           throws IOException, IllegalArgumentException;
-
-    /**
-     *
-     * Emits start of map entry.
-     *
-     * <p>
-     * End of map entry event is emitted by invoking {@link #endNode()}.
-     *
-     * <p>
-     * Valid sub-events are:
-     * <ul>
-     * <li>{@link #leafNode(String, Object)}</li>
-     * <li>{@link #startContainerNode(Class, int)}</li>
-     * <li>{@link #startChoiceNode(Class, int)}</li>
-     * <li>{@link #startLeafSet(String, int)}</li>
-     * <li>{@link #startMapNode(Class, int)}</li>
-     * <li>{@link #startUnkeyedList(Class, int)}</li>
-     * <li>{@link #startAugmentationNode(Class)}</li>
-     * </ul>
-     *
-     * @param keyValues
-     *            Key of map entry node
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalArgumentException
-     *             If key contains incorrect value.
-     * @throws IllegalStateException
-     *             If node was emitted outside <code>map entry</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startMapEntryNode(Identifier<?> keyValues, int childSizeHint) throws IOException, IllegalArgumentException;
-
-    /**
-     * Emits start of choice node.
-     *
-     * <p>
-     * Valid sub-event in {@link #startCase(Class, int)}, which selects case
-     * which should be written.
-     *
-     * @param choice
-     *            Choice class.
-     * @param childSizeHint
-     *            Non-negative count of expected direct child nodes or
-     *            {@link #UNKNOWN_SIZE} if count is unknown. This is only hint
-     *            and should not fail writing of child events, if there are more
-     *            events than count.
-     * @throws IllegalArgumentException
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>, <code>choice</code>,
-     *             <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startChoiceNode(Class<? extends InterfaceTyped> choice, int childSizeHint) throws IOException, IllegalArgumentException;
-
-    /**
-     *
-     * Starts a case node.
-     *
-     * <p>
-     * Valid sub-events are:
-     * <ul>
-     * <li>{@link #leafNode(String, Object)}</li>
-     * <li>{@link #startContainerNode(Class, int)}</li>
-     * <li>{@link #startChoiceNode(Class, int)}</li>
-     * <li>{@link #startLeafSet(String, int)}</li>
-     * <li>{@link #startMapNode(Class, int)}</li>
-     * <li>{@link #startUnkeyedList(Class, int)}</li>
-     * <li>{@link #startAugmentationNode(Class)}</li>
-     * </ul>
-     *
-     * @param caze Case class
-     * @throws IllegalArgumentException
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startCase(Class<? extends TreeNode> caze, int childSizeHint) throws IOException, IllegalArgumentException;
-
-    /**
-     * Emits start of augmentation node.
-     *
-     * <p>
-     * End of augmentation event is emitted by invoking {@link #endNode()}.
-     *
-     * <p>
-     * Valid sub-events are:
-     *
-     * <ul>
-     * <li>{@link #leafNode(String, Object)}</li>
-     * <li>{@link #startContainerNode(Class, int)}</li>
-     * <li>{@link #startChoiceNode(Class, int)}</li>
-     * <li>{@link #startLeafSet(String, int)}</li>
-     * <li>{@link #startMapNode(Class, int)}</li>
-     * <li>{@link #startUnkeyedList(Class, int)}</li>
-     * </ul>
-     *
-     * <p>
-     * Note this is only method, which does not require childSizeHint, since
-     * maximum value is always size of <code>possibleChildren</code>.
-     *
-     * @param augmentationType augmentation class
-     * @throws IllegalArgumentException
-     *             If augmentation is invalid in current context.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void startAugmentationNode(Class<? extends Augmentation<?>> augmentationType) throws IOException, IllegalArgumentException;
-
-    /**
-     * Emits anyxml node event.
-     *
-     * @param name
-     * @param value
-     * @throws IllegalArgumentException
-     * @throws IllegalStateException
-     *             If node was emitted inside <code>map</code>,
-     *             <code>choice</code> <code>unkeyed list</code> node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void anyxmlNode(String name, Object value) throws IOException, IllegalArgumentException;
-
-    /**
-     * Emits end event for node.
-     *
-     * @throws IllegalStateException If there is no open node.
-     * @throws IOException if an underlying IO error occurs
-     */
-    void endNode() throws IOException, IllegalStateException;
-
-    @Override
-    void flush() throws IOException;
-
-    @Override
-    void close() throws IOException;
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/ChildTreeNode.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/ChildTreeNode.java
deleted file mode 100644 (file)
index 4084ebe..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * Child of parent container
- *
- * Marker interface uniquelly bounding generated Java interfaces to their
- * parent container.
- *
- * Any nested Java interface generated from YANG must implement this interface,
- * where parameter <code>P</code> points to it's defining data node container
- * (interface generated for List, Container, Case).
- *
- * In case of children added by augmentation (which implements {@link Augmentation})
- * interfaces representing nested container must implements {@link ChildTreeNode} with
- * same argument as Augmentation.
- *
- * @param <P> Parent container
- */
-public interface ChildTreeNode<P> extends TreeNode {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializer.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializer.java
deleted file mode 100644 (file)
index bd3a2a4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import java.io.IOException;
-
-/**
- * A serializer which writes DataObject to supplied stream event writer.
- */
-public interface DataObjectSerializer {
-    /**
-     * Writes stream events representing object to supplied stream
-     *
-     * @param obj
-     *            Source of stream events
-     * @param stream
-     *            Stream to which events should be written.
-     */
-    void serialize(TreeNode obj, BindingStreamEventWriter stream) throws IOException;
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializerImplementation.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializerImplementation.java
deleted file mode 100644 (file)
index 229d9f2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import java.io.IOException;
-
-/**
- * SPI-level contract for implementations of {@link DataObjectSerializer}.
- * The contract is kept between implementation of {@link DataObjectSerializerRegistry},
- * which maintains the lookup context required for recursive serialization.
- *
- * FIXME: this interface needs to be moved into .spi, but due to classpath funkyness
- *        of OSGi, that change has to be carefully orchestrated to ensure proper imports
- *        exist in all generated packages. One avenue how to achieve that is to move
- *        {@link YangModuleInfo} and modify code generator to add a static field
- *        to all generated classes which will point to the per-model YangModuleInfo
- *        (currently all users of it have to walk the package hierarchy, so that
- *        is an improvement in and of itself).
- *
- */
-public interface DataObjectSerializerImplementation {
-    /**
-     *
-     * Writes stream events for supplied data object to provided stream.
-     *
-     * DataObjectSerializerRegistry may be used to lookup serializers
-     * for other generated classes  in order to support writing
-     * their events.
-     *
-     */
-    void serialize(DataObjectSerializerRegistry reg, TreeNode obj, BindingStreamEventWriter stream) throws IOException;
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializerRegistry.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/DataObjectSerializerRegistry.java
deleted file mode 100644 (file)
index 6e2a67e..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * SPI-level contract for registry of {@link DataObjectSerializer}.
- * The contract is kept between implementation of {@link DataObjectSerializerImplementation},
- * Registry provides lookup for serializers to support recursive
- * serialization of nested {@link TreeNode}s.
- *
- * FIXME: this interface needs to be moved into .spi, but due to classpath funkyness
- *        of OSGi, that change has to be carefully orchestrated to ensure proper imports
- *        exist in all generated pacakges. One avenue how to achieve that is to move
- *        {@link YangModuleInfo} and modify code generator to add a static field
- *        to all generated classes which will point to the per-model YangModuleInfo
- *        (currently all users of it have to walk the package hierarchy, so that
- *        is an improvement in and of itself).
- *
- */
-public interface DataObjectSerializerRegistry {
-
-    DataObjectSerializer getSerializer(Class<? extends TreeNode> binding);
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/IdentifiableListItem.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/IdentifiableListItem.java
deleted file mode 100644 (file)
index 82a8425..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-
-/**
- * IdentifiableListItem object, which could be identified by it's key
- *
- * @param <T> Identifier class for this object
- *
- */
-public interface IdentifiableListItem<T extends Identifier<? extends IdentifiableListItem<T>>> {
-
-    /**
-     * Returns an unique identifier for the object
-     *
-     * @return Identifier for the object
-     */
-    T identifier();
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Identifier.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Identifier.java
deleted file mode 100644 (file)
index 9b2c0d5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- *
- * Object is unique identifier for another object
- *
- *
- *
- * @param <T>
- *            Class of object for which this object is identifier
- * @author ttkacik
- */
-public interface Identifier<T extends IdentifiableListItem<?>> extends org.opendaylight.yangtools.concepts.Identifier {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifier.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifier.java
deleted file mode 100644 (file)
index 9839262..0000000
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableCollection;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import java.io.IOException;
-import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.concepts.Immutable;
-import org.opendaylight.yangtools.concepts.Path;
-import org.opendaylight.yangtools.util.HashCodeBuilder;
-
-/**
- *
- * This instance identifier uniquely identifies a specific DataObject in the data tree modeled by YANG.
- *
- * For Example let's say you were trying to refer to a node in inventory which was modeled in YANG as follows,
- *
- * <pre>
- * module opendaylight-inventory {
- *      ....
- *
- *      container nodes {
- *        list node {
- *            key "id";
- *            ext:context-instance "node-context";
- *
- *            uses node;
- *        }
- *    }
- *
- * }
- * </pre>
- *
- * You could create an instance identifier as follows to get to a node with id "openflow:1"
- *
- * InstanceIdentifierBuilder.builder(Nodes.class).child(Node.class, new NodeKey(new NodeId("openflow:1")).build();
- *
- * This would be the same as using a path like so, "/nodes/node/openflow:1" to refer to the openflow:1 node
- *
- */
-public class InstanceIdentifier<T extends TreeNode> implements Path<InstanceIdentifier<? extends TreeNode>>, Immutable, Serializable {
-    private static final Field PATHARGUMENTS_FIELD;
-    private static final long serialVersionUID = 2L;
-    /*
-     * Protected to differentiate internal and external access. Internal
-     * access is required never to modify the contents. References passed
-     * to outside entities have to be wrapped in an unmodifiable view.
-     */
-    protected transient final Iterable<PathArgument> pathArguments;
-    private final Class<T> targetType;
-    private final boolean wildcarded;
-    private final int hash;
-
-    static {
-        final Field f;
-        try {
-            f = InstanceIdentifier.class.getDeclaredField("pathArguments");
-        } catch (NoSuchFieldException | SecurityException e) {
-            throw new ExceptionInInitializerError(e);
-        }
-        f.setAccessible(true);
-        PATHARGUMENTS_FIELD = f;
-    }
-
-    InstanceIdentifier(final Class<T> type, final Iterable<PathArgument> pathArguments, final boolean wildcarded, final int hash) {
-        this.pathArguments = Preconditions.checkNotNull(pathArguments);
-        this.targetType = Preconditions.checkNotNull(type);
-        this.wildcarded = wildcarded;
-        this.hash = hash;
-    }
-
-    /**
-     * Return the type of data which this InstanceIdentifier identifies.
-     *
-     * @return Target type
-     */
-    public final Class<T> getTargetType() {
-        return targetType;
-    }
-
-    /**
-     * Return the path argument chain which makes up this instance identifier.
-     *
-     * @return Path argument chain. Immutable and does not contain nulls.
-     */
-    public final Iterable<PathArgument> getPathArguments() {
-        return Iterables.unmodifiableIterable(pathArguments);
-    }
-
-    /**
-     * Check whether an instance identifier contains any wildcards. A wildcard
-     * is an path argument which has a null key.
-     *
-     * @return true if any of the path arguments has a null key.
-     */
-    public final boolean isWildcarded() {
-        return wildcarded;
-    }
-
-    @Override
-    public final int hashCode() {
-        return hash;
-    }
-
-    @Override
-    public final boolean equals(final Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-
-        final InstanceIdentifier<?> other = (InstanceIdentifier<?>) obj;
-        if (pathArguments == other.pathArguments) {
-            return true;
-        }
-
-        /*
-         * We could now just go and compare the pathArguments, but that
-         * can be potentially expensive. Let's try to avoid that by
-         * checking various things that we have cached from pathArguments
-         * and trying to prove the identifiers are *not* equal.
-         */
-        if (hash != other.hash) {
-            return false;
-        }
-        if (wildcarded != other.wildcarded) {
-            return false;
-        }
-        if (targetType != other.targetType) {
-            return false;
-        }
-        if (fastNonEqual(other)) {
-            return false;
-        }
-
-        // Everything checks out so far, so we have to do a full equals
-        return Iterables.elementsEqual(pathArguments, other.pathArguments);
-    }
-
-    /**
-     * Perform class-specific fast checks for non-equality. This allows
-     * subclasses to avoid iterating over the pathArguments by performing
-     * quick checks on their specific fields.
-     *
-     * @param other The other identifier, guaranteed to be the same class
-     * @return true if the other identifier cannot be equal to this one.
-     */
-    protected boolean fastNonEqual(final InstanceIdentifier<?> other) {
-        return false;
-    }
-
-    @Override
-    public final String toString() {
-        return addToStringAttributes(MoreObjects.toStringHelper(this)).toString();
-    }
-
-    /**
-     * Add class-specific toString attributes.
-     *
-     * @param toStringHelper ToStringHelper instance
-     * @return ToStringHelper instance which was passed in
-     */
-    protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
-        return toStringHelper.add("targetType", targetType).add("path", Iterables.toString(pathArguments));
-    }
-
-    /**
-     * Return an instance identifier trimmed at the first occurrence of a
-     * specific component type.
-     *
-     * For example let's say an instance identifier was built like so,
-     * <pre>
-     *      identifier = InstanceIdentifierBuilder.builder(Nodes.class).child(Node.class, new NodeKey(new NodeId("openflow:1")).build();
-     * </pre>
-     *
-     * And you wanted to obtain the Instance identifier which represented Nodes you would do it like so,
-     *
-     * <pre>
-     *      identifier.firstIdentifierOf(Nodes.class)
-     * </pre>
-     *
-     * @param type component type
-     * @return trimmed instance identifier, or null if the component type
-     *         is not present.
-     */
-    public final <I extends TreeNode> InstanceIdentifier<I> firstIdentifierOf(final Class<I> type) {
-        int i = 1;
-        for (final PathArgument a : pathArguments) {
-            if (type.equals(a.getType())) {
-                @SuppressWarnings("unchecked")
-                final InstanceIdentifier<I> ret = (InstanceIdentifier<I>) internalCreate(Iterables.limit(pathArguments, i));
-                return ret;
-            }
-
-            ++i;
-        }
-
-        return null;
-    }
-
-    /**
-     * Return the key associated with the first component of specified type in
-     * an identifier.
-     *
-     * @param listItem component type
-     * @param listKey component key type
-     * @return key associated with the component, or null if the component type
-     *         is not present.
-     *
-     * @deprecated Use {@link #firstKeyOf(Class)} instead.
-     */
-    @Deprecated
-    public final <N extends IdentifiableListItem<K> & TreeNode, K extends Identifier<N>> K firstKeyOf(final Class<N> listItem, final Class<K> listKey) {
-        return firstKeyOf(listItem);
-    }
-
-    /**
-     * Return the key associated with the first component of specified type in
-     * an identifier.
-     *
-     * @param listItem component type
-     * @return key associated with the component, or null if the component type
-     *         is not present.
-     */
-    public final <N extends IdentifiableListItem<K> & TreeNode, K extends Identifier<N>> K firstKeyOf(final Class<N> listItem) {
-        for (final PathArgument i : pathArguments) {
-            if (listItem.equals(i.getType())) {
-                @SuppressWarnings("unchecked")
-                final K ret = ((IdentifiableItem<N, K>)i).getKey();
-                return ret;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Check whether an identifier is contained in this identifier. This is a strict subtree check, which requires all
-     * PathArguments to match exactly, e.g.
-     *
-     *
-     * The contains method checks if the other identifier is fully contained within the current identifier. It does this
-     * by looking at only the types of the path arguments and not by comparing the path arguments themselves.
-     *
-     * To illustrate here is an example which explains the working of this API.
-     *
-     * Let's say you have two instance identifiers as follows,
-     *
-     * this = /nodes/node/openflow:1
-     * other = /nodes/node/openflow:2
-     *
-     * then this.contains(other) will return false.
-     *
-     * @param other
-     * @return
-     */
-    @Override
-    public final boolean contains(final InstanceIdentifier<? extends TreeNode> other) {
-        Preconditions.checkNotNull(other, "other should not be null");
-
-        final Iterator<?> lit = pathArguments.iterator();
-        final Iterator<?> oit = other.pathArguments.iterator();
-
-        while (lit.hasNext()) {
-            if (!oit.hasNext()) {
-                return false;
-            }
-
-            if (!lit.next().equals(oit.next())) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Check whether this instance identifier contains the other identifier after wildcard expansion. This is similar
-     * to {@link #contains(InstanceIdentifier)}, with the exception that a wildcards are assumed to match the their
-     * non-wildcarded PathArgument counterpart.
-     *
-     * @param other Identifier which should be checked for inclusion.
-     * @return true if this identifier contains the other object
-     */
-    public final boolean containsWildcarded(final InstanceIdentifier<?> other) {
-        Preconditions.checkNotNull(other, "other should not be null");
-
-        final Iterator<PathArgument> lit = pathArguments.iterator();
-        final Iterator<PathArgument> oit = other.pathArguments.iterator();
-
-        while (lit.hasNext()) {
-            if (!oit.hasNext()) {
-                return false;
-            }
-
-            final PathArgument la = lit.next();
-            final PathArgument oa = oit.next();
-
-            if (!la.getType().equals(oa.getType())) {
-                return false;
-            }
-            if (la instanceof IdentifiableItem<?, ?> && oa instanceof IdentifiableItem<?, ?> && !la.equals(oa)) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Create a builder rooted at this key.
-     *
-     * @return A builder instance
-     */
-    public InstanceIdentifierBuilder<T> builder() {
-        return new InstanceIdentifierBuilderImpl<T>(new Item<T>(targetType), pathArguments, hash, isWildcarded());
-    }
-
-    private InstanceIdentifier<?> childIdentifier(final PathArgument arg) {
-        return trustedCreate(arg, Iterables.concat(pathArguments, Collections.singleton(arg)), HashCodeBuilder.nextHashCode(hash, arg), isWildcarded());
-    }
-
-    @SuppressWarnings("unchecked")
-    public final <N extends ChildTreeNode<? super T>> InstanceIdentifier<N> child(final Class<N> container) {
-        final PathArgument arg = new Item<>(container);
-        return (InstanceIdentifier<N>) childIdentifier(arg);
-    }
-
-    @SuppressWarnings("unchecked")
-    public final <N extends IdentifiableListItem<K> & ChildTreeNode<? super T>, K extends Identifier<N>> KeyedInstanceIdentifier<N, K> child(
-            final Class<N> listItem, final K listKey) {
-        final PathArgument arg = new IdentifiableItem<>(listItem, listKey);
-        return (KeyedInstanceIdentifier<N, K>) childIdentifier(arg);
-    }
-
-    @SuppressWarnings("unchecked")
-    public final <N extends TreeNode & Augmentation<? super T>> InstanceIdentifier<N> augmentation(
-            final Class<N> container) {
-        final PathArgument arg = new Item<>(container);
-        return (InstanceIdentifier<N>) childIdentifier(arg);
-    }
-
-    @Deprecated
-    private List<PathArgument> legacyCache;
-
-    /**
-     * @deprecated Use {@link #getPathArguments()} instead.
-     */
-    @Deprecated
-    public final List<PathArgument> getPath() {
-        if (legacyCache == null) {
-            legacyCache = ImmutableList.<PathArgument>copyOf(pathArguments);
-        }
-
-        return legacyCache;
-    }
-
-    /**
-     * Create a new InstanceIdentifierBuilder given a base InstanceIdentifier
-     *
-     * @param base
-     * @param <T>
-     * @return
-     *
-     * @deprecated Use {@link #builder()} instead.
-     */
-    @Deprecated
-    public static <T extends TreeNode> InstanceIdentifierBuilder<T> builder(final InstanceIdentifier<T> base) {
-        return base.builder();
-    }
-
-    /**
-     * Create an InstanceIdentifierBuilder for a specific type of InstanceIdentifier as specified by container
-     *
-     * @param container
-     * @param <T>
-     * @return
-     */
-    public static <T extends ChildTreeNode<? extends TreeRoot>> InstanceIdentifierBuilder<T> builder(final Class<T> container) {
-        return new InstanceIdentifierBuilderImpl<T>().addNode(container);
-    }
-
-    /**
-     * Create an InstanceIdentifierBuilder for a specific type of InstanceIdentifier which represents an IdentifiableItem
-     *
-     * @param listItem
-     * @param listKey
-     * @param <N>
-     * @param <K>
-     * @return
-     */
-    public static <N extends IdentifiableListItem<K> & ChildTreeNode<? extends TreeRoot>, K extends Identifier<N>> InstanceIdentifierBuilder<N> builder(
-            final Class<N> listItem, final K listKey) {
-        return new InstanceIdentifierBuilderImpl<N>().addNode(listItem, listKey);
-    }
-
-    /**
-     * Create an instance identifier for a very specific object type. This method
-     * implements {@link #create(Iterable)} semantics, except it is used by internal
-     * callers, which have assured that the argument is an immutable Iterable.
-     *
-     *
-     * @param pathArguments The path to a specific node in the data tree
-     * @return InstanceIdentifier instance
-     * @throws IllegalArgumentException if pathArguments is empty or
-     *         contains a null element.
-     */
-    private static InstanceIdentifier<?> internalCreate(final Iterable<PathArgument> pathArguments) {
-        final Iterator<? extends PathArgument> it = Preconditions.checkNotNull(pathArguments, "pathArguments may not be null").iterator();
-        final HashCodeBuilder<PathArgument> hashBuilder = new HashCodeBuilder<>();
-        boolean wildcard = false;
-        PathArgument a = null;
-
-        while (it.hasNext()) {
-            a = it.next();
-            Preconditions.checkArgument(a != null, "pathArguments may not contain null elements");
-
-            // TODO: sanity check ChildOf<>;
-            hashBuilder.addArgument(a);
-
-            if (IdentifiableListItem.class.isAssignableFrom(a.getType()) && !(a instanceof IdentifiableItem<?, ?>)) {
-                wildcard = true;
-            }
-        }
-        Preconditions.checkArgument(a != null, "pathArguments may not be empty");
-
-        return trustedCreate(a, pathArguments, hashBuilder.build(), wildcard);
-    }
-
-    /**
-     * Create an instance identifier for a very specific object type.
-     *
-     * Example
-     * <pre>
-     *  List&lt;PathArgument&gt; path = Arrays.asList(new Item(Nodes.class))
-     *  new InstanceIdentifier(path);
-     * </pre>
-     *
-     * @param pathArguments The path to a specific node in the data tree
-     * @return InstanceIdentifier instance
-     * @throws IllegalArgumentException if pathArguments is empty or
-     *         contains a null element.
-     */
-    public static InstanceIdentifier<?> create(final Iterable<? extends PathArgument> pathArguments) {
-        if (pathArguments instanceof ImmutableCollection<?>) {
-            @SuppressWarnings("unchecked")
-            final Iterable<PathArgument> immutableArguments = (Iterable<PathArgument>) pathArguments;
-            return internalCreate(immutableArguments);
-        } else {
-            return internalCreate(ImmutableList.copyOf(pathArguments));
-        }
-    }
-
-    /**
-     * Create an instance identifier for a very specific object type.
-     *
-     * For example
-     * <pre>
-     *      new InstanceIdentifier(Nodes.class)
-     * </pre>
-     * would create an InstanceIdentifier for an object of type Nodes
-     *
-     * @param type The type of the object which this instance identifier represents
-     * @return InstanceIdentifier instance
-     */
-    @SuppressWarnings("unchecked")
-    public static <T extends TreeNode> InstanceIdentifier<T> create(final Class<T> type) {
-        return (InstanceIdentifier<T>) create(Collections.<PathArgument> singletonList(new Item<>(type)));
-    }
-
-    /**
-     * Return the key associated with the last component of the specified identifier.
-     *
-     * @param id instance identifier
-     * @return key associated with the last component
-     * @throws IllegalArgumentException if the supplied identifier type cannot have a key.
-     * @throws NullPointerException if id is null.
-     */
-    public static <N extends IdentifiableListItem<K> & TreeNode, K extends Identifier<N>> K keyOf(final InstanceIdentifier<N> id) {
-        Preconditions.checkNotNull(id);
-        Preconditions.checkArgument(id instanceof KeyedInstanceIdentifier, "%s does not have a key", id);
-
-        @SuppressWarnings("unchecked")
-        final K ret = ((KeyedInstanceIdentifier<N, K>)id).getKey();
-        return ret;
-    }
-
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    static InstanceIdentifier<?> trustedCreate(final PathArgument arg, final Iterable<PathArgument> pathArguments, final int hash, boolean wildcarded) {
-        if (IdentifiableListItem.class.isAssignableFrom(arg.getType()) && !(wildcarded)) {
-            Identifier<?> key = null;
-            if (arg instanceof IdentifiableItem<?, ?>) {
-                key = ((IdentifiableItem<?, ?>)arg).key;
-            } else {
-                wildcarded = true;
-            }
-
-            return new KeyedInstanceIdentifier(arg.getType(), pathArguments, wildcarded, hash, key);
-        } else {
-            return new InstanceIdentifier(arg.getType(), pathArguments, wildcarded, hash);
-        }
-    }
-
-    /**
-     * Path argument of {@link InstanceIdentifier}.
-     * <p>
-     * Interface which implementations are used as path components of the
-     * path in overall data tree.
-     */
-    public interface PathArgument extends Comparable<PathArgument> {
-        Class<? extends TreeNode> getType();
-    }
-
-    private static abstract class AbstractPathArgument<T extends TreeNode> implements PathArgument, Serializable {
-        private static final long serialVersionUID = 1L;
-        private final Class<T> type;
-
-        protected AbstractPathArgument(final Class<T> type) {
-            this.type = Preconditions.checkNotNull(type, "Type may not be null.");
-        }
-
-        @Override
-        public final Class<T> getType() {
-            return type;
-        }
-
-        @Override
-        public int hashCode() {
-            return type.hashCode();
-        }
-
-        @Override
-        public boolean equals(final Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            final AbstractPathArgument<?> other = (AbstractPathArgument<?>) obj;
-            return type.equals(other.type);
-        }
-
-        @Override
-        public int compareTo(final PathArgument arg) {
-            return type.getCanonicalName().compareTo(arg.getType().getCanonicalName());
-        }
-    }
-
-    /**
-     * An Item represents an object that probably is only one of it's kind. For example a Nodes object is only one of
-     * a kind. In YANG terms this would probably represent a container.
-     *
-     * @param <T>
-     */
-    public static final class Item<T extends TreeNode> extends AbstractPathArgument<T> {
-        private static final long serialVersionUID = 1L;
-
-        public Item(final Class<T> type) {
-            super(type);
-        }
-
-        @Override
-        public String toString() {
-            return getType().getName();
-        }
-    }
-
-    /**
-     * An IdentifiableItem represents a object that is usually present in a collection and can be identified uniquely
-     * by a key. In YANG terms this would probably represent an item in a list.
-     *
-     * @param <I> An object that is identifiable by an identifier
-     * @param <T> The identifier of the object
-     */
-    public static final class IdentifiableItem<I extends IdentifiableListItem<T> & TreeNode, T extends Identifier<I>> extends AbstractPathArgument<I> {
-        private static final long serialVersionUID = 1L;
-        private final T key;
-
-        public IdentifiableItem(final Class<I> type, final T key) {
-            super(type);
-            this.key = Preconditions.checkNotNull(key, "Key may not be null.");
-        }
-
-        public T getKey() {
-            return this.key;
-        }
-
-        @Override
-        public boolean equals(final Object obj) {
-            return super.equals(obj) && key.equals(((IdentifiableItem<?, ?>) obj).getKey());
-        }
-
-        @Override
-        public int hashCode() {
-            return super.hashCode() * 31 + key.hashCode();
-        }
-
-        @Override
-        public String toString() {
-            return getType().getName() + "[key=" + key + "]";
-        }
-    }
-
-
-    public interface InstanceIdentifierBuilder<T extends TreeNode> extends Builder<InstanceIdentifier<T>> {
-        /**
-         * Append the specified container as a child of the current InstanceIdentifier referenced by the builder.
-         *
-         * This method should be used when you want to build an instance identifier by appending top-level
-         * elements
-         *
-         * Example,
-         * <pre>
-         *     InstanceIdentifier.builder().child(Nodes.class).build();
-         *
-         * </pre>
-         *
-         * NOTE :- The above example is only for illustration purposes InstanceIdentifier.builder() has been deprecated
-         * and should not be used. Use InstanceIdentifier.builder(Nodes.class) instead
-         *
-         * @param container
-         * @param <N>
-         * @return
-         */
-        <N extends ChildTreeNode<? super T>> InstanceIdentifierBuilder<N> child(
-                Class<N> container);
-
-        /**
-         * Append the specified listItem as a child of the current InstanceIdentifier referenced by the builder.
-         *
-         * This method should be used when you want to build an instance identifier by appending a specific list element
-         * to the identifier
-         *
-         * @param listItem
-         * @param listKey
-         * @param <N>
-         * @param <K>
-         * @return
-         */
-        <N extends IdentifiableListItem<K> & ChildTreeNode<? super T>, K extends Identifier<N>> InstanceIdentifierBuilder<N> child(
-                Class<N> listItem, K listKey);
-
-        /**
-         * Build an identifier which refers to a specific augmentation of the current InstanceIdentifier referenced by
-         * the builder
-         *
-         * @param container
-         * @param <N>
-         * @return
-         */
-        <N extends TreeNode & Augmentation<? super T>> InstanceIdentifierBuilder<N> augmentation(
-                Class<N> container);
-
-        /**
-         * Build the instance identifier.
-         *
-         * @return
-         */
-        @Override
-        InstanceIdentifier<T> build();
-
-        /*
-         * @deprecated use #build()
-         */
-        @Deprecated
-        InstanceIdentifier<T> toInstance();
-    }
-
-    private void writeObject(final java.io.ObjectOutputStream out) throws IOException {
-        out.defaultWriteObject();
-        out.writeInt(Iterables.size(pathArguments));
-        for (Object o : pathArguments) {
-            out.writeObject(o);
-        }
-    }
-
-    private void readObject(final java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
-        in.defaultReadObject();
-
-        final int size = in.readInt();
-        final List<PathArgument> args = new ArrayList<>(size);
-        for (int i = 0; i < size; ++i) {
-            args.add((PathArgument) in.readObject());
-        }
-
-        try {
-            PATHARGUMENTS_FIELD.set(this, ImmutableList.copyOf(args));
-        } catch (IllegalArgumentException | IllegalAccessException e) {
-            throw new IOException(e);
-        }
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifierBuilderImpl.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifierBuilderImpl.java
deleted file mode 100644 (file)
index 2f4ec1d..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import org.opendaylight.yangtools.util.HashCodeBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
-
-final class InstanceIdentifierBuilderImpl<T extends TreeNode> implements InstanceIdentifier.InstanceIdentifierBuilder<T> {
-    private final ImmutableList.Builder<PathArgument> pathBuilder = ImmutableList.builder();
-    private final HashCodeBuilder<PathArgument> hashBuilder;
-    private final Iterable<? extends PathArgument> basePath;
-    private boolean wildcard = false;
-    private PathArgument arg = null;
-
-    InstanceIdentifierBuilderImpl() {
-        this.hashBuilder = new HashCodeBuilder<>();
-        this.basePath = null;
-    }
-
-    InstanceIdentifierBuilderImpl(final PathArgument item, final Iterable<? extends PathArgument> pathArguments, final int hash, final boolean wildcard) {
-        this.hashBuilder = new HashCodeBuilder<>(hash);
-        this.basePath = pathArguments;
-        this.wildcard = wildcard;
-        this.arg = item;
-    }
-
-    @Override
-    public int hashCode() {
-        return hashBuilder.build();
-    }
-
-    @SuppressWarnings("unchecked")
-    <N extends TreeNode> InstanceIdentifierBuilderImpl<N> addNode(final Class<N> container) {
-        arg = new Item<N>(container);
-        hashBuilder.addArgument(arg);
-        pathBuilder.add(arg);
-
-        if (IdentifiableListItem.class.isAssignableFrom(container)) {
-            wildcard = true;
-        }
-
-        return (InstanceIdentifierBuilderImpl<N>) this;
-    }
-
-    @SuppressWarnings("unchecked")
-    <N extends TreeNode & IdentifiableListItem<K>, K extends Identifier<N>> InstanceIdentifierBuilderImpl<N> addNode(final Class<N> listItem, final K listKey) {
-        arg = new IdentifiableItem<N, K>(listItem, listKey);
-        hashBuilder.addArgument(arg);
-        pathBuilder.add(arg);
-        return (InstanceIdentifierBuilderImpl<N>) this;
-    }
-
-    @Override
-    public <N extends ChildTreeNode<? super T>> InstanceIdentifierBuilderImpl<N> child(final Class<N> container) {
-        return addNode(container);
-    }
-
-    @Override
-    public <N extends IdentifiableListItem<K> & ChildTreeNode<? super T>, K extends Identifier<N>> InstanceIdentifierBuilderImpl<N> child(final Class<N> listItem, final K listKey) {
-        return addNode(listItem, listKey);
-    }
-
-    /**
-     * Build an identifier which refers to a specific augmentation of the current InstanceIdentifier referenced by
-     * the builder
-     *
-     * @param container
-     * @param <N>
-     * @return
-     */
-    @Override
-    public <N extends TreeNode & Augmentation<? super T>> InstanceIdentifierBuilderImpl<N> augmentation(final Class<N> container) {
-        return addNode(container);
-    }
-
-    @Override
-    public InstanceIdentifier<T> build() {
-        Preconditions.checkState(arg != null, "No path arguments present");
-
-        final Iterable<PathArgument> pathArguments;
-        if (basePath == null) {
-            pathArguments = pathBuilder.build();
-        } else {
-            pathArguments = Iterables.concat(basePath, pathBuilder.build());
-        }
-
-        @SuppressWarnings("unchecked")
-        final InstanceIdentifier<T> ret = (InstanceIdentifier<T>) InstanceIdentifier.trustedCreate(arg, pathArguments, hashBuilder.build(), wildcard);
-        return ret;
-    }
-
-    /*
-     * @deprecated Use #build() instead.
-     */
-    @Override
-    @Deprecated
-    public InstanceIdentifier<T> toInstance() {
-        return build();
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InterfaceTyped.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/InterfaceTyped.java
deleted file mode 100644 (file)
index 5528dcc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * InterfaceTyped - object contains structured data
- *
- * Marker interface which must be implemented by all interfaces
- * generated for YANG:
- * <ul>
- * <li>Rpc Input
- * <li>Output
- * <li>Notification
- * <li>Container
- * <li>List
- * <li>Case
- * </ul>
- */
-public interface InterfaceTyped {
-    //FIXME: add generics
-
-    Class<? extends InterfaceTyped> implementedInterface();
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/KeyedInstanceIdentifier.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/KeyedInstanceIdentifier.java
deleted file mode 100644 (file)
index 5d76ced..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * An {@link InstanceIdentifier}, which has a list key attached at its last path
- * element.
- *
- * @param <T> Target data type
- * @param <K> Target key type
- */
-public class KeyedInstanceIdentifier<T extends IdentifiableListItem<K> & TreeNode, K extends Identifier<T>> extends InstanceIdentifier<T> {
-    private static final long serialVersionUID = 1L;
-    private final K key;
-
-    KeyedInstanceIdentifier(final Class<T> type, final Iterable<PathArgument> pathArguments, final boolean wildcarded, final int hash, final K key) {
-        super(type, pathArguments, wildcarded, hash);
-        this.key = key;
-    }
-
-    /**
-     * Return the key attached to this identifier. This method is equivalent to
-     * calling {@link InstanceIdentifier#keyOf(InstanceIdentifier)}.
-     *
-     * @return Key associated with this instance identifier.
-     */
-    public final K getKey() {
-        return key;
-    }
-
-    @Override
-    public final InstanceIdentifierBuilder<T> builder() {
-        return new InstanceIdentifierBuilderImpl<T>(new InstanceIdentifier.IdentifiableItem<T, K>(getTargetType(), key), pathArguments, hashCode(), isWildcarded());
-    }
-
-    @Override
-    protected boolean fastNonEqual(final InstanceIdentifier<?> other) {
-        final KeyedInstanceIdentifier<?, ?> kii = (KeyedInstanceIdentifier<?, ?>) other;
-
-        /*
-         * We could do an equals() here, but that may actually be expensive.
-         * equals() in superclass falls back to a full compare, which will
-         * end up running that equals anyway, so do not bother here.
-         */
-        return (key == null) != (kii.key == null);
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Notification.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/Notification.java
deleted file mode 100644 (file)
index 5903e5e..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * Marker interface for YANG-defined notifications
- *
- *
- */
-public interface Notification extends InterfaceTyped {
-
-}
-
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/NotificationListener.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/NotificationListener.java
deleted file mode 100644 (file)
index e896c9f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import java.util.EventListener;
-
-/**
- * Marker interface for generated notification listener interfaces. This interface
- * exists solely as support for generated code. Users should never implement this
- * interface directly, but rather implement one of the sub-interfaces generated
- * from a YANG model.
- *
- * <p>
- * The subclasses of this interface have callbacks for events, which are derived
- * from {@link Notification} class in form void
- * on{NotificationType}(NotificationType notification).
- *
- * <p>
- * E.g. if we have notification SessionUp the callback will have signature:
- * <code>void  onSessionUp(SessionUp notification)</code>
- */
-public interface NotificationListener extends EventListener {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcImplementation.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcImplementation.java
deleted file mode 100644 (file)
index 229e35e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import java.util.Set;
-import java.util.concurrent.Future;
-
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-public interface RpcImplementation {
-
-    // Fixme: Change to RpcInput
-    Set<Class<? extends InterfaceTyped>> getSupportedInputs();
-
-    // Fixme: Change to RpcInput
-    <T extends InterfaceTyped> Future<RpcResult<?>> invoke(Class<T> type, T input);
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcInput.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcInput.java
deleted file mode 100644 (file)
index 89f4314..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-public interface RpcInput extends InterfaceTyped {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcService.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/RpcService.java
deleted file mode 100644 (file)
index f2f160a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- * Marker interface for tagging generated YANG Modules
- *
- */
-public interface RpcService {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/TreeNode.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/TreeNode.java
deleted file mode 100644 (file)
index c924285..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- *
- * Data container is an interface which has structured contents.
- *
- */
-public interface TreeNode extends InterfaceTyped {
-
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/TreeRoot.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/TreeRoot.java
deleted file mode 100644 (file)
index e22b27d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-/**
- *
- * Root node without any parent
- *
- */
-public interface TreeRoot extends TreeNode {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/YangModelBindingProvider.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/YangModelBindingProvider.java
deleted file mode 100644 (file)
index 9a5fd63..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import java.util.ServiceLoader;
-
-/**
- *
- * Provider of YangModuleInfo for specified package / model.
- *
- * Implementation of this interface should be discoverable
- * via {@link ServiceLoader}
- *
- *
- *
- */
-public interface YangModelBindingProvider {
-
-    /**
-     * YangModuleInfo associated to package
-     *
-     * @return
-     */
-    YangModuleInfo getModuleInfo();
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/YangModuleInfo.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/YangModuleInfo.java
deleted file mode 100644 (file)
index 2affcce..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.util.Set;
-
-public interface YangModuleInfo {
-
-    /**
-     * Returns yang module name
-     *
-     * @return
-     */
-    String getName();
-
-    /**
-     *
-     * Returns revision of yang module.
-     *
-     * @return
-     */
-    String getRevision();
-
-    /**
-     * Returns XML namespace associated to the YANG module
-     *
-     * @return XML namespace associated to the YANG module.
-     */
-    String getNamespace();
-
-    InputStream getModuleSourceStream() throws IOException;
-
-    Set<YangModuleInfo> getImportedModules();
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/ModuleQName.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/ModuleQName.java
deleted file mode 100644 (file)
index fceccc7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Maintains information about yang module from which class using this annotation was generated.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.PACKAGE})
-public @interface ModuleQName {
-    String namespace();
-    String revision();
-    String name();
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/QName.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/QName.java
deleted file mode 100644 (file)
index 49fb66f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.annotations;
-
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface QName {
-
-    String namespace();
-    String revision();
-    String name();
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/RoutingContext.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/RoutingContext.java
deleted file mode 100644 (file)
index 514945a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.annotations;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.opendaylight.yangtools.yang.binding.BaseIdentity;
-
-
-@Inherited
-@Documented
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface RoutingContext {
-
-    Class<? extends BaseIdentity> value();
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/package-info.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/package-info.java
deleted file mode 100644 (file)
index eee24a9..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
\ No newline at end of file
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/AbstractMappedRpcInvoker.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/AbstractMappedRpcInvoker.java
deleted file mode 100644 (file)
index ac9777d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.Future;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-abstract class AbstractMappedRpcInvoker<T> extends RpcServiceInvoker {
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractMappedRpcInvoker.class);
-    private final Map<T, RpcMethodInvoker> map;
-
-    protected AbstractMappedRpcInvoker(final Map<T, Method> map) {
-        final Builder<T, RpcMethodInvoker> b = ImmutableMap.builder();
-
-        for (Entry<T, Method> e : map.entrySet()) {
-            if (BindingReflections.isRpcMethod(e.getValue())) {
-                b.put(e.getKey(), RpcMethodInvoker.from(e.getValue()));
-            } else {
-                LOG.debug("Method {} is not an RPC method, ignoring it", e.getValue());
-            }
-        }
-
-        this.map = b.build();
-    }
-
-    protected abstract T qnameToKey(final QName qname);
-
-    @Override
-    public final Future<RpcResult<?>> invokeRpc(@Nonnull final RpcService impl, @Nonnull final QName rpcName, @Nullable final TreeNode input) {
-        Preconditions.checkNotNull(impl, "implemetation must be supplied");
-
-        RpcMethodInvoker invoker = map.get(qnameToKey(rpcName));
-        Preconditions.checkArgument(invoker != null, "Supplied RPC is not valid for implementation %s", impl);
-        return invoker.invokeOn(impl, input);
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/AugmentationFieldGetter.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/AugmentationFieldGetter.java
deleted file mode 100644 (file)
index ce86bb1..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.base.Preconditions;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodHandles.Lookup;
-import java.lang.invoke.MethodType;
-import java.lang.reflect.Field;
-import java.util.Collections;
-import java.util.Map;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
-import org.opendaylight.yangtools.yang.binding.BindingMapping;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-abstract class AugmentationFieldGetter {
-
-    private static final Logger LOG = LoggerFactory.getLogger(AugmentationFieldGetter.class);
-
-    private static final AugmentationFieldGetter DUMMY = new AugmentationFieldGetter() {
-        @Override
-        protected Map<Class<? extends Augmentation<?>>, Augmentation<?>> getAugmentations(final Object input) {
-            return Collections.emptyMap();
-        }
-    };
-
-    private static final AugmentationFieldGetter AUGMENTATION_HOLDER_GETTER = new AugmentationFieldGetter() {
-
-        @Override
-        @SuppressWarnings({"unchecked", "rawtypes"})
-        protected Map<Class<? extends Augmentation<?>>, Augmentation<?>> getAugmentations(final Object input) {
-            return (Map) ((AugmentationHolder<?>) input).augmentations();
-        }
-    };
-
-    /**
-     *
-     * Retrieves augmentations from supplied object
-     *
-     * @param input Input Data object, from which augmentations should be extracted
-     * @return Map of Augmentation class to augmentation
-     */
-    protected abstract Map<Class<? extends Augmentation<?>>, Augmentation<?>> getAugmentations(final Object input);
-
-    private static final LoadingCache<Class<?>, AugmentationFieldGetter> AUGMENTATION_GETTERS = CacheBuilder
-            .newBuilder().weakKeys().build(new AugmentationGetterLoader());
-
-    public static AugmentationFieldGetter getGetter(final Class<? extends Object> clz) {
-        if(AugmentationHolder.class.isAssignableFrom(clz)) {
-            return AUGMENTATION_HOLDER_GETTER;
-        }
-        return AUGMENTATION_GETTERS.getUnchecked(clz);
-    }
-
-    private static final class AugmentationGetterLoader extends CacheLoader<Class<?>, AugmentationFieldGetter> {
-        private static final MethodType GETTER_TYPE = MethodType.methodType(Map.class, Object.class);
-        private static final Lookup LOOKUP = MethodHandles.lookup();
-
-        @Override
-        public AugmentationFieldGetter load(final Class<?> key) throws IllegalAccessException {
-            final Field field;
-            try {
-                field = key.getDeclaredField(BindingMapping.AUGMENTATION_FIELD);
-                field.setAccessible(true);
-            } catch (NoSuchFieldException | SecurityException e) {
-                LOG.warn("Failed to acquire augmentation field {}, ignoring augmentations in class {}",
-                    BindingMapping.AUGMENTATION_FIELD, key, e);
-                return DUMMY;
-            }
-            if (!Map.class.isAssignableFrom(field.getType())) {
-                LOG.warn("Class {} field {} is not a Map, ignoring augmentations", key,
-                    BindingMapping.AUGMENTATION_FIELD);
-                return DUMMY;
-            }
-
-            return new ReflectionAugmentationFieldGetter(LOOKUP.unreflectGetter(field).asType(GETTER_TYPE));
-        }
-    }
-
-    private static final class ReflectionAugmentationFieldGetter extends AugmentationFieldGetter {
-        private final MethodHandle fieldGetter;
-
-        ReflectionAugmentationFieldGetter(final MethodHandle mh) {
-            this.fieldGetter = Preconditions.checkNotNull(mh);
-        }
-
-        @Override
-        protected Map<Class<? extends Augmentation<?>>, Augmentation<?>> getAugmentations(final Object input) {
-            try {
-                return (Map<Class<? extends Augmentation<?>>, Augmentation<?>>) fieldGetter.invokeExact(input);
-            } catch (Throwable e) {
-                throw new IllegalStateException("Failed to access augmentation field on " + input, e);
-            }
-        }
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/BindingReflections.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/BindingReflections.java
deleted file mode 100644 (file)
index 1dc4706..0000000
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.ImmutableSet.Builder;
-import com.google.common.collect.Sets;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.ServiceLoader;
-import java.util.concurrent.Callable;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.opendaylight.yangtools.util.ClassLoaderUtils;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.BaseIdentity;
-import org.opendaylight.yangtools.yang.binding.BindingMapping;
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.binding.InterfaceTyped;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.Notification;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BindingReflections {
-
-    private static final long EXPIRATION_TIME = 60;
-    private static final String ROOT_PACKAGE_PATTERN_STRING = "(org.opendaylight.yang.gen.v1.[a-z0-9_\\.]*\\.rev[0-9][0-9][0-1][0-9][0-3][0-9])";
-    private static final Pattern ROOT_PACKAGE_PATTERN = Pattern.compile(ROOT_PACKAGE_PATTERN_STRING);
-    private static final Logger LOG = LoggerFactory.getLogger(BindingReflections.class);
-
-    private static final LoadingCache<Class<?>, Optional<QName>> CLASS_TO_QNAME = CacheBuilder.newBuilder() //
-            .weakKeys() //
-            .expireAfterAccess(EXPIRATION_TIME, TimeUnit.SECONDS) //
-            .build(new ClassToQNameLoader());
-
-    private BindingReflections() {
-        throw new UnsupportedOperationException("Utility class.");
-    }
-
-    /**
-     * Find augmentation target class from concrete Augmentation class
-     *
-     * This method uses first generic argument of implemented
-     * {@link Augmentation} interface.
-     *
-     * @param augmentation
-     *            {@link Augmentation} subclass for which we want to determine
-     *            augmentation target.
-     * @return Augmentation target - class which augmentation provides
-     *         additional extensions.
-     */
-    public static Class<? extends Augmentable<?>> findAugmentationTarget(
-            final Class<? extends Augmentation<?>> augmentation) {
-        return ClassLoaderUtils.findFirstGenericArgument(augmentation, Augmentation.class);
-    }
-
-    /**
-     * Find data hierarchy parent from concrete Data class
-     *
-     * This method uses first generic argument of implemented {@link ChildTreeNode}
-     * interface.
-     *
-     * @param childClass
-     *            child class for which we want to find the parent class.
-     * @return Parent class, e.g. class of which the childClass is ChildOf.
-     */
-    public static Class<?> findHierarchicalParent(final Class<? extends ChildTreeNode<?>> childClass) {
-        return ClassLoaderUtils.findFirstGenericArgument(childClass, ChildTreeNode.class);
-    }
-
-    /**
-     * Find data hierarchy parent from concrete Data class
-     *
-     * This method is shorthand which gets DataObject class by invoking
-     * {@link TreeNode#implementedInterface()} and uses
-     * {@link #findHierarchicalParent(Class)}.
-     *
-     * @param child
-     *            Child object for which the parent needs to be located.
-     * @return Parent class, or null if a parent is not found.
-     */
-    public static Class<?> findHierarchicalParent(final TreeNode child) {
-        if (child instanceof ChildTreeNode) {
-            return ClassLoaderUtils.findFirstGenericArgument(child.implementedInterface(), ChildTreeNode.class);
-        }
-        return null;
-    }
-
-    /**
-     * Returns a QName associated to supplied type
-     *
-     * @param dataType
-     * @return QName associated to supplied dataType. If dataType is
-     *         Augmentation method does not return canonical QName, but QName
-     *         with correct namespace revision, but virtual local name, since
-     *         augmentations do not have name.
-     *
-     *         May return null if QName is not present.
-     */
-    public static final QName findQName(final Class<?> dataType) {
-        return CLASS_TO_QNAME.getUnchecked(dataType).orNull();
-    }
-
-    /**
-     * Checks if method is RPC invocation
-     *
-     *
-     *
-     * @param possibleMethod
-     *            Method to check
-     * @return true if method is RPC invocation, false otherwise.
-     */
-    public static boolean isRpcMethod(final Method possibleMethod) {
-        return possibleMethod != null && RpcService.class.isAssignableFrom(possibleMethod.getDeclaringClass())
-                && Future.class.isAssignableFrom(possibleMethod.getReturnType())
-                && possibleMethod.getParameterTypes().length <= 1;
-    }
-
-    /**
-     *
-     * Extracts Output class for RPC method
-     *
-     * @param targetMethod
-     *            method to scan
-     * @return Optional.empty() if result type could not be get, or return type
-     *         is Void.
-     */
-    @SuppressWarnings("rawtypes")
-    public static Optional<Class<?>> resolveRpcOutputClass(final Method targetMethod) {
-        checkState(isRpcMethod(targetMethod), "Supplied method is not Rpc invocation method");
-        Type futureType = targetMethod.getGenericReturnType();
-        Type rpcResultType = ClassLoaderUtils.getFirstGenericParameter(futureType);
-        Type rpcResultArgument = ClassLoaderUtils.getFirstGenericParameter(rpcResultType);
-        if (rpcResultArgument instanceof Class && !Void.class.equals(rpcResultArgument)) {
-            return Optional.<Class<?>> of((Class) rpcResultArgument);
-        }
-        return Optional.empty();
-    }
-
-    /**
-     *
-     * Extracts input class for RPC method
-     *
-     * @param targetMethod
-     *            method to scan
-     * @return Optional.empty() if rpc has no input, Rpc input type otherwise.
-     */
-    @SuppressWarnings("unchecked")
-    public static Optional<Class<? extends InterfaceTyped>> resolveRpcInputClass(final Method targetMethod) {
-        @SuppressWarnings("rawtypes")
-        Class[] types = targetMethod.getParameterTypes();
-        if (types.length == 0) {
-            return Optional.empty();
-        }
-        if (types.length == 1) {
-            return Optional.<Class<? extends InterfaceTyped>> of(types[0]);
-        }
-        throw new IllegalArgumentException("Method has 2 or more arguments.");
-    }
-
-    public static QName getQName(final Class<? extends BaseIdentity> context) {
-        return findQName(context);
-    }
-
-    /**
-     *
-     * Checks if class is child of augmentation.
-     *
-     *
-     * @param clazz
-     * @return
-     */
-    public static boolean isAugmentationChild(final Class<?> clazz) {
-        // FIXME: Current resolver could be still confused when
-        // child node was added by grouping
-        checkArgument(clazz != null);
-
-        @SuppressWarnings({ "rawtypes", "unchecked" })
-        Class<?> parent = findHierarchicalParent((Class) clazz);
-        if (parent == null) {
-            LOG.debug("Did not find a parent for class {}", clazz);
-            return false;
-        }
-
-        String clazzModelPackage = getModelRootPackageName(clazz.getPackage());
-        String parentModelPackage = getModelRootPackageName(parent.getPackage());
-
-        return !clazzModelPackage.equals(parentModelPackage);
-    }
-
-    /**
-     * Returns root package name for suplied package.
-     *
-     * @param pkg
-     *            Package for which find model root package.
-     * @return Package of model root.
-     */
-    public static String getModelRootPackageName(final Package pkg) {
-        return getModelRootPackageName(pkg.getName());
-    }
-
-    /**
-     * Returns root package name for supplied package name.
-     *
-     * @param name
-     *            Package for which find model root package.
-     * @return Package of model root.
-     */
-    public static String getModelRootPackageName(final String name) {
-        checkArgument(name != null, "Package name should not be null.");
-        checkArgument(name.startsWith(BindingMapping.PACKAGE_PREFIX), "Package name not starting with %s, is: %s",
-                BindingMapping.PACKAGE_PREFIX, name);
-        Matcher match = ROOT_PACKAGE_PATTERN.matcher(name);
-        checkArgument(match.find(), "Package name '%s' does not match required pattern '%s'", name,
-                ROOT_PACKAGE_PATTERN_STRING);
-        return match.group(0);
-    }
-
-    public static final QNameModule getQNameModule(final Class<?> clz) {
-        if(InterfaceTyped.class.isAssignableFrom(clz) || BaseIdentity.class.isAssignableFrom(clz)) {
-            return findQName(clz).getModule();
-        }
-        try {
-            YangModuleInfo modInfo = BindingReflections.getModuleInfo(clz);
-            return getQNameModule(modInfo);
-        } catch (Exception e) {
-            throw new IllegalStateException("Unable to get QName of defining model.", e);
-        }
-    }
-
-    public static final QNameModule getQNameModule(final YangModuleInfo modInfo) {
-        return QNameModule.create(URI.create(modInfo.getNamespace()), QName.parseRevision(modInfo.getRevision()));
-    }
-
-    /**
-     *
-     * Returns instance of {@link YangModuleInfo} of declaring model for
-     * specific class.
-     *
-     * @param cls
-     * @return Instance of {@link YangModuleInfo} associated with model, from
-     *         which this class was derived.
-     * @throws Exception
-     */
-    public static YangModuleInfo getModuleInfo(final Class<?> cls) throws Exception {
-        checkArgument(cls != null);
-        String packageName = getModelRootPackageName(cls.getPackage());
-        final String potentialClassName = getModuleInfoClassName(packageName);
-        return ClassLoaderUtils.withClassLoader(cls.getClassLoader(), new Callable<YangModuleInfo>() {
-            @Override
-            public YangModuleInfo call() throws ClassNotFoundException, IllegalAccessException,
-                    IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
-                Class<?> moduleInfoClass = Thread.currentThread().getContextClassLoader().loadClass(potentialClassName);
-                return (YangModuleInfo) moduleInfoClass.getMethod("getInstance").invoke(null);
-            }
-        });
-    }
-
-    public static String getModuleInfoClassName(final String packageName) {
-        return packageName + "." + BindingMapping.MODULE_INFO_CLASS_NAME;
-    }
-
-    /**
-     *
-     * Check if supplied class is derived from YANG model.
-     *
-     * @param cls
-     *            Class to check
-     * @return true if class is derived from YANG model.
-     */
-    public static boolean isBindingClass(final Class<?> cls) {
-        if (InterfaceTyped.class.isAssignableFrom(cls) || Augmentation.class.isAssignableFrom(cls)) {
-            return true;
-        }
-        return (cls.getName().startsWith(BindingMapping.PACKAGE_PREFIX));
-    }
-
-    /**
-     *
-     * Checks if supplied method is callback for notifications.
-     *
-     * @param method
-     * @return true if method is notification callback.
-     */
-    public static boolean isNotificationCallback(final Method method) {
-        checkArgument(method != null);
-        if (method.getName().startsWith("on") && method.getParameterTypes().length == 1) {
-            Class<?> potentialNotification = method.getParameterTypes()[0];
-            if (isNotification(potentialNotification)
-                    && method.getName().equals("on" + potentialNotification.getSimpleName())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     *
-     * Checks is supplied class is Notification.
-     *
-     * @param potentialNotification
-     * @return
-     */
-    public static boolean isNotification(final Class<?> potentialNotification) {
-        checkArgument(potentialNotification != null, "potentialNotification must not be null.");
-        return Notification.class.isAssignableFrom(potentialNotification);
-    }
-
-    /**
-     *
-     * Loads {@link YangModuleInfo} infos available on current classloader.
-     *
-     * This method is shorthand for {@link #loadModuleInfos(ClassLoader)} with
-     * {@link Thread#getContextClassLoader()} for current thread.
-     *
-     * @return Set of {@link YangModuleInfo} available for current classloader.
-     */
-    public static ImmutableSet<YangModuleInfo> loadModuleInfos() {
-        return loadModuleInfos(Thread.currentThread().getContextClassLoader());
-    }
-
-    /**
-     *
-     * Loads {@link YangModuleInfo} infos available on supplied classloader.
-     *
-     * {@link YangModuleInfo} are discovered using {@link ServiceLoader} for
-     * {@link YangModelBindingProvider}. {@link YangModelBindingProvider} are
-     * simple classes which holds only pointers to actual instance
-     * {@link YangModuleInfo}.
-     *
-     * When {@link YangModuleInfo} is available, all dependencies are
-     * recursivelly collected into returning set by collecting results of
-     * {@link YangModuleInfo#getImportedModules()}.
-     *
-     *
-     * @param loader
-     *            Classloader for which {@link YangModuleInfo} should be
-     *            retrieved.
-     * @return Set of {@link YangModuleInfo} available for supplied classloader.
-     */
-    public static ImmutableSet<YangModuleInfo> loadModuleInfos(final ClassLoader loader) {
-        Builder<YangModuleInfo> moduleInfoSet = ImmutableSet.<YangModuleInfo> builder();
-        ServiceLoader<YangModelBindingProvider> serviceLoader = ServiceLoader.load(YangModelBindingProvider.class,
-                loader);
-        for (YangModelBindingProvider bindingProvider : serviceLoader) {
-            YangModuleInfo moduleInfo = bindingProvider.getModuleInfo();
-            checkState(moduleInfo != null, "Module Info for %s is not available.", bindingProvider.getClass());
-            collectYangModuleInfo(bindingProvider.getModuleInfo(), moduleInfoSet);
-        }
-        return moduleInfoSet.build();
-    }
-
-    private static void collectYangModuleInfo(final YangModuleInfo moduleInfo,
-            final Builder<YangModuleInfo> moduleInfoSet) {
-        moduleInfoSet.add(moduleInfo);
-        for (YangModuleInfo dependency : moduleInfo.getImportedModules()) {
-            collectYangModuleInfo(dependency, moduleInfoSet);
-        }
-    }
-
-    /**
-     *
-     * Checks if supplied class represents RPC Input / RPC Output.
-     *
-     * @param targetType
-     *            Class to be checked
-     * @return true if class represents RPC Input or RPC Output class.
-     */
-    public static boolean isRpcType(final Class<? extends TreeNode> targetType) {
-        return InterfaceTyped.class.isAssignableFrom(targetType) //
-                && !ChildTreeNode.class.isAssignableFrom(targetType) //
-                && !Notification.class.isAssignableFrom(targetType) //
-                && (targetType.getName().endsWith("Input") || targetType.getName().endsWith("Output"));
-    }
-
-    /**
-     *
-     * Scans supplied class and returns an iterable of all data children
-     * classes.
-     *
-     * @param type
-     *            YANG Modeled Entity derived from DataContainer
-     * @return Iterable of all data children, which have YANG modeled entity
-     */
-    @SuppressWarnings("unchecked")
-    public static Iterable<Class<? extends TreeNode>> getChildrenClasses(final Class<? extends InterfaceTyped> type) {
-        checkArgument(type != null, "Target type must not be null");
-        checkArgument(InterfaceTyped.class.isAssignableFrom(type), "Supplied type must be derived from DataContainer");
-        List<Class<? extends TreeNode>> ret = new LinkedList<>();
-        for (Method method : type.getMethods()) {
-            Optional<Class<? extends InterfaceTyped>> entity = getYangModeledReturnType(method);
-            if (entity.isPresent()) {
-                ret.add((Class<? extends TreeNode>) entity.get());
-            }
-        }
-        return ret;
-    }
-
-    /**
-     *
-     * Scans supplied class and returns an iterable of all data children
-     * classes.
-     *
-     * @param type
-     *            YANG Modeled Entity derived from DataContainer
-     * @return Iterable of all data children, which have YANG modeled entity
-     */
-    public static Map<Class<?>, Method> getChildrenClassToMethod(final Class<?> type) {
-        checkArgument(type != null, "Target type must not be null");
-        checkArgument(InterfaceTyped.class.isAssignableFrom(type), "Supplied type must be derived from DataContainer");
-        Map<Class<?>, Method> ret = new HashMap<>();
-        for (Method method : type.getMethods()) {
-            Optional<Class<? extends InterfaceTyped>> entity = getYangModeledReturnType(method);
-            if (entity.isPresent()) {
-                ret.put(entity.get(), method);
-            }
-        }
-        return ret;
-    }
-
-    @SuppressWarnings("unchecked")
-    private static Optional<Class<? extends InterfaceTyped>> getYangModeledReturnType(final Method method) {
-        if (method.getName().equals("getClass") || !method.getName().startsWith("get")
-                || method.getParameterTypes().length > 0) {
-            return Optional.empty();
-        }
-
-        @SuppressWarnings("rawtypes")
-        Class returnType = method.getReturnType();
-        if (InterfaceTyped.class.isAssignableFrom(returnType)) {
-            return Optional.<Class<? extends InterfaceTyped>> of(returnType);
-        } else if (List.class.isAssignableFrom(returnType)) {
-            try {
-                return ClassLoaderUtils.withClassLoader(method.getDeclaringClass().getClassLoader(),
-                        new Callable<Optional<Class<? extends InterfaceTyped>>>() {
-                            @SuppressWarnings("rawtypes")
-                            @Override
-                            public Optional<Class<? extends InterfaceTyped>> call() {
-                                Type listResult = ClassLoaderUtils.getFirstGenericParameter(method
-                                        .getGenericReturnType());
-                                if (listResult instanceof Class
-                                        && InterfaceTyped.class.isAssignableFrom((Class) listResult)) {
-                                    return Optional.<Class<? extends InterfaceTyped>> of((Class) listResult);
-                                }
-                                return Optional.empty();
-                            }
-
-                        });
-            } catch (Exception e) {
-                /*
-                 *
-                 * It is safe to log this this exception on debug, since this
-                 * method should not fail. Only failures are possible if the
-                 * runtime / backing.
-                 */
-                LOG.debug("Unable to find YANG modeled return type for {}", method, e);
-            }
-        }
-        return Optional.empty();
-    }
-
-    private static class ClassToQNameLoader extends CacheLoader<Class<?>, Optional<QName>> {
-
-        @Override
-        public Optional<QName> load(final Class<?> key) throws Exception {
-            return resolveQNameNoCache(key);
-        }
-    }
-
-    /**
-     *
-     * Tries to resolve QName for supplied class.
-     *
-     * Looks up for static field with name from constant
-     * {@link BindingMapping#QNAME_STATIC_FIELD_NAME} and returns value if
-     * present.
-     *
-     * If field is not present uses {@link #computeQName(Class)} to compute
-     * QName for missing types.
-     *
-     * @param key
-     * @return
-     */
-    private static Optional<QName> resolveQNameNoCache(final Class<?> key) {
-        try {
-            Field field = key.getField(BindingMapping.QNAME_STATIC_FIELD_NAME);
-            Object obj = field.get(null);
-            if (obj instanceof QName) {
-                return Optional.of((QName) obj);
-            }
-
-        } catch (NoSuchFieldException e) {
-            return Optional.of(computeQName(key));
-
-        } catch (SecurityException | IllegalArgumentException | IllegalAccessException e) {
-            /*
-             *
-             * It is safe to log this this exception on debug, since this method
-             * should not fail. Only failures are possible if the runtime /
-             * backing.
-             */
-            LOG.debug("Unexpected exception during extracting QName for {}", key, e);
-        }
-        return Optional.empty();
-    }
-
-    /**
-     * Computes QName for supplied class
-     *
-     * Namespace and revision are same as {@link YangModuleInfo} associated with
-     * supplied class.
-     * <p>
-     * If class is
-     * <ul>
-     * <li>rpc input: local name is "input".
-     * <li>rpc output: local name is "output".
-     * <li>augmentation: local name is "module name".
-     * </ul>
-     *
-     * There is also fallback, if it is not possible to compute QName using
-     * following algorithm returns module QName.
-     *
-     * FIXME: Extend this algorithm to also provide QName for YANG modeled
-     * simple types.
-     *
-     * @throws IllegalStateException
-     *             If YangModuleInfo could not be resolved
-     * @throws IllegalArgumentException
-     *             If supplied class was not derived from YANG model.
-     *
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    private static QName computeQName(final Class key) {
-        if (isBindingClass(key)) {
-            YangModuleInfo moduleInfo;
-            try {
-                moduleInfo = getModuleInfo(key);
-            } catch (Exception e) {
-                throw new IllegalStateException("Unable to get QName for " + key + ". YangModuleInfo was not found.", e);
-            }
-            final QName module = getModuleQName(moduleInfo).intern();
-            if (Augmentation.class.isAssignableFrom(key)) {
-                return module;
-            } else if (isRpcType(key)) {
-                final String className = key.getSimpleName();
-                if (className.endsWith(BindingMapping.RPC_OUTPUT_SUFFIX)) {
-                    return QName.create(module, "output").intern();
-                } else {
-                    return QName.create(module, "input").intern();
-                }
-            }
-            /*
-             * Fallback for Binding types which do not have QNAME field
-             */
-            return module;
-        } else {
-            throw new IllegalArgumentException("Supplied class " + key + "is not derived from YANG.");
-        }
-    }
-
-    /**
-     * Given a {@link YangModuleInfo}, create a QName representing it. The QName
-     * is formed by reusing the module's namespace and revision using the
-     * module's name as the QName's local name.
-     *
-     * @param moduleInfo
-     *            module information
-     * @return QName representing the module
-     */
-    public static QName getModuleQName(final YangModuleInfo moduleInfo) {
-        checkArgument(moduleInfo != null, "moduleInfo must not be null.");
-        return QName.create(moduleInfo.getNamespace(), moduleInfo.getRevision(), moduleInfo.getName());
-    }
-
-    /**
-     * Extracts augmentation from Binding DTO field using reflection
-     *
-     * @param input
-     *            Instance of DataObject which is augmentable and may contain
-     *            augmentation
-     * @return Map of augmentations if read was successful, otherwise empty map.
-     */
-    public static Map<Class<? extends Augmentation<?>>, Augmentation<?>> getAugmentations(final Augmentable<?> input) {
-        return AugmentationFieldGetter.getGetter(input.getClass()).getAugmentations(input);
-    }
-
-    /**
-     *
-     * Determines if two augmentation classes or case classes represents same
-     * data.
-     * <p>
-     * Two augmentations or cases could be substituted only if and if:
-     * <ul>
-     * <li>Both implements same interfaces</li>
-     * <li>Both have same children</li>
-     * <li>If augmentations: Both have same augmentation target class. Target
-     * class was generated for data node in grouping.</li>
-     * <li>If cases: Both are from same choice. Choice class was generated for
-     * data node in grouping.</li>
-     * </ul>
-     * <p>
-     * <b>Explanation:</b> Binding Specification reuses classes generated for
-     * groupings as part of normal data tree, this classes from grouping could
-     * be used at various locations and user may not be aware of it and may use
-     * incorrect case or augmentation in particular subtree (via copy
-     * constructors, etc).
-     *
-     * @param potential
-     *            Class which is potential substition
-     * @param target
-     *            Class which should be used at particular subtree
-     * @return true if and only if classes represents same data.
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public static boolean isSubstitutionFor(final Class potential, final Class target) {
-        HashSet<Class> subImplemented = Sets.newHashSet(potential.getInterfaces());
-        HashSet<Class> targetImplemented = Sets.newHashSet(target.getInterfaces());
-        if (!subImplemented.equals(targetImplemented)) {
-            return false;
-        }
-        if (Augmentation.class.isAssignableFrom(potential)
-                && !BindingReflections.findAugmentationTarget(potential).equals(
-                        BindingReflections.findAugmentationTarget(target))) {
-            return false;
-        }
-        for (Method potentialMethod : potential.getMethods()) {
-            try {
-                Method targetMethod = target.getMethod(potentialMethod.getName(), potentialMethod.getParameterTypes());
-                if (!potentialMethod.getReturnType().equals(targetMethod.getReturnType())) {
-                    return false;
-                }
-            } catch (NoSuchMethodException e) {
-                // Counterpart method is missing, so classes could not be
-                // substituted.
-                return false;
-            } catch (SecurityException e) {
-                throw new IllegalStateException("Could not compare methods", e);
-            }
-        }
-        return true;
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/ClassBasedRpcServiceInvoker.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/ClassBasedRpcServiceInvoker.java
deleted file mode 100644 (file)
index 8063869..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.base.Preconditions;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-import org.opendaylight.yangtools.yang.binding.BindingMapping;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.QName;
-
-final class ClassBasedRpcServiceInvoker extends AbstractMappedRpcInvoker<String> {
-    private static final LoadingCache<Class<? extends RpcService>, RpcServiceInvoker> INVOKERS = CacheBuilder.newBuilder()
-            .weakKeys()
-            .build(new CacheLoader<Class<? extends RpcService>, RpcServiceInvoker>() {
-                @Override
-                public RpcServiceInvoker load(final Class<? extends RpcService> key) {
-                    final Map<String, Method> ret = new HashMap<>();
-                    for (Method m : key.getMethods()) {
-                        ret.put(m.getName(), m);
-                    }
-
-                    return new ClassBasedRpcServiceInvoker(ret);
-                }
-            });
-
-    ClassBasedRpcServiceInvoker(final Map<String, Method> ret) {
-        super(ret);
-    }
-
-    @Override
-    protected String qnameToKey(final QName qname) {
-        return BindingMapping.getMethodName(qname);
-    }
-
-    static RpcServiceInvoker instanceFor(final Class<? extends RpcService> type) {
-        Preconditions.checkArgument(type.isInterface());
-        Preconditions.checkArgument(BindingReflections.isBindingClass(type));
-        return INVOKERS.getUnchecked(type);
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/ClassLoaderUtils.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/ClassLoaderUtils.java
deleted file mode 100644 (file)
index cfb23c0..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.Preconditions;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.locks.Lock;
-import java.util.function.Supplier;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @deprecated Use {@link org.opendaylight.yangtools.util.ClassLoaderUtils} instead.
- */
-@Deprecated
-public final class ClassLoaderUtils {
-    private static final Logger LOG = LoggerFactory.getLogger(ClassLoaderUtils.class);
-
-    private ClassLoaderUtils() {
-        throw new UnsupportedOperationException("Utility class");
-    }
-
-    /**
-     *
-     * Runs {@link Supplier} with provided {@link ClassLoader}.
-     *
-     * Invokes supplies function and makes sure that original {@link ClassLoader}
-     * is context {@link ClassLoader} after execution.
-     *
-     * @param cls {@link ClassLoader} to be used.
-     * @param function Function to be executed.
-     * @return Result of supplier invocation.
-     *
-     */
-    public static <V> V withClassLoader(final ClassLoader cls, final Supplier<V> function) {
-        checkNotNull(cls, "Classloader should not be null");
-        checkNotNull(function, "Function should not be null");
-
-        final ClassLoader oldCls = Thread.currentThread().getContextClassLoader();
-        try {
-            Thread.currentThread().setContextClassLoader(cls);
-            return function.get();
-        } finally {
-            Thread.currentThread().setContextClassLoader(oldCls);
-        }
-    }
-
-    /**
-     *
-     * Runs {@link Callable} with provided {@link ClassLoader}.
-     *
-     * Invokes supplies function and makes sure that original {@link ClassLoader}
-     * is context {@link ClassLoader} after execution.
-     *
-     * @param cls {@link ClassLoader} to be used.
-     * @param function Function to be executed.
-     * @return Result of callable invocation.
-     *
-     */
-    public static <V> V withClassLoader(final ClassLoader cls, final Callable<V> function) throws Exception {
-        checkNotNull(cls, "Classloader should not be null");
-        checkNotNull(function, "Function should not be null");
-
-        final ClassLoader oldCls = Thread.currentThread().getContextClassLoader();
-        try {
-            Thread.currentThread().setContextClassLoader(cls);
-            return function.call();
-        } finally {
-            Thread.currentThread().setContextClassLoader(oldCls);
-        }
-    }
-
-    /**
-     *
-     * Runs {@link Callable} with provided {@link ClassLoader} and Lock.
-     *
-     * Invokes supplies function after acquiring lock
-     * and makes sure that original {@link ClassLoader}
-     * is context {@link ClassLoader} and lock is unlocked
-     * after execution.
-     *
-     * @param cls {@link ClassLoader} to be used.
-     * @param function Function to be executed.
-     * @return Result of Callable invocation.
-     *
-     */
-    public static <V> V withClassLoaderAndLock(final ClassLoader cls, final Lock lock, final Supplier<V> function) {
-        checkNotNull(lock, "Lock should not be null");
-
-        lock.lock();
-        try {
-            return withClassLoader(cls, function);
-        } finally {
-            lock.unlock();
-        }
-    }
-
-    public static Object construct(final Constructor<? extends Object> constructor, final List<Object> objects)
-            throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
-        final Object[] initargs = objects.toArray();
-        return constructor.newInstance(initargs);
-    }
-
-    /**
-     *
-     * Loads class using this supplied classloader.
-     *
-     *
-     * @param cls
-     * @param name String name of class.
-     * @return
-     * @throws ClassNotFoundException
-     */
-    public static Class<?> loadClass(final ClassLoader cls, final String name) throws ClassNotFoundException {
-        if ("byte[]".equals(name)) {
-            return byte[].class;
-        }
-        if ("char[]".equals(name)) {
-            return char[].class;
-        }
-
-        try {
-            return cls.loadClass(name);
-        } catch (ClassNotFoundException e) {
-            String[] components = name.split("\\.");
-            String potentialOuter;
-            int length = components.length;
-            if (length > 2 && (potentialOuter = components[length - 2]) != null && Character.isUpperCase(potentialOuter.charAt(0))) {
-                String outerName = Joiner.on(".").join(Arrays.asList(components).subList(0, length - 1));
-                String innerName = outerName + "$" + components[length-1];
-                return cls.loadClass(innerName);
-            } else {
-                throw e;
-            }
-        }
-    }
-
-    public static Class<?> loadClassWithTCCL(final String name) throws ClassNotFoundException {
-        return loadClass(Thread.currentThread().getContextClassLoader(), name);
-    }
-
-    public static Class<?> tryToLoadClassWithTCCL(final String fullyQualifiedName) {
-        try {
-            return loadClassWithTCCL(fullyQualifiedName);
-        } catch (ClassNotFoundException e) {
-            LOG.debug("Failed to load class {}", fullyQualifiedName, e);
-            return null;
-        }
-    }
-
-    public static <S,G,P> Class<P> findFirstGenericArgument(final Class<S> scannedClass, final Class<G> genericType) {
-        return withClassLoader(scannedClass.getClassLoader(), ClassLoaderUtils.<S,G,P>findFirstGenericArgumentTask(scannedClass, genericType));
-    }
-
-    private static <S,G,P> Supplier<Class<P>> findFirstGenericArgumentTask(final Class<S> scannedClass, final Class<G> genericType) {
-        return new Supplier<Class<P>>() {
-            @Override
-            @SuppressWarnings("unchecked")
-            public Class<P> get() {
-                final ParameterizedType augmentationGeneric = findParameterizedType(scannedClass, genericType);
-                if (augmentationGeneric != null) {
-                    return (Class<P>) augmentationGeneric.getActualTypeArguments()[0];
-                }
-                return null;
-            }
-        };
-    }
-
-    public static ParameterizedType findParameterizedType(final Class<?> subclass, final Class<?> genericType) {
-        Preconditions.checkNotNull(subclass);
-        Preconditions.checkNotNull(genericType);
-
-        for (Type type : subclass.getGenericInterfaces()) {
-            if (type instanceof ParameterizedType && genericType.equals(((ParameterizedType) type).getRawType())) {
-                return (ParameterizedType) type;
-            }
-        }
-
-        LOG.debug("Class {} does not declare interface {}", subclass, genericType);
-        return null;
-    }
-
-    public static Type getFirstGenericParameter(final Type type) {
-        if (type instanceof ParameterizedType) {
-            return ((ParameterizedType) type).getActualTypeArguments()[0];
-        }
-        return null;
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/DataObjectReadingUtil.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/DataObjectReadingUtil.java
deleted file mode 100644 (file)
index 48159a5..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import org.opendaylight.yangtools.yang.binding.Augmentable;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.InterfaceTyped;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.IdentifiableListItem;
-import org.opendaylight.yangtools.yang.binding.Identifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
-
-public class DataObjectReadingUtil {
-
-    private DataObjectReadingUtil() {
-        throw new UnsupportedOperationException("Utility class. Instantion is not allowed.");
-    }
-
-    /**
-     *
-     * @param parent
-     *            Parent object on which read operation will be performed
-     * @param parentPath
-     *            Path, to parent object.
-     * @param childPath
-     *            Path, which is nested to parent, and should be readed.
-     * @return Value of object.
-     */
-    public static final <T extends TreeNode, P extends TreeNode> Map<InstanceIdentifier<T>, T> readData(final P parent,
-                                                                                                        final InstanceIdentifier<P> parentPath, final InstanceIdentifier<T> childPath) {
-        checkArgument(parent != null, "Parent must not be null.");
-        checkArgument(parentPath != null, "Parent path must not be null");
-        checkArgument(childPath != null, "Child path must not be null");
-        checkArgument(parentPath.containsWildcarded(childPath), "Parent object must be parent of child.");
-
-        List<PathArgument> pathArgs = subList(parentPath.getPathArguments(), childPath.getPathArguments());
-        @SuppressWarnings("rawtypes")
-        Map<InstanceIdentifier, InterfaceTyped> lastFound = Collections
-                .<InstanceIdentifier, InterfaceTyped> singletonMap(parentPath, parent);
-        for (PathArgument pathArgument : pathArgs) {
-            @SuppressWarnings("rawtypes")
-            final ImmutableMap.Builder<InstanceIdentifier, InterfaceTyped> potentialBuilder = ImmutableMap.builder();
-            for (@SuppressWarnings("rawtypes")
-            Entry<InstanceIdentifier, InterfaceTyped> entry : lastFound.entrySet()) {
-                potentialBuilder.putAll(readData(entry, pathArgument));
-            }
-            lastFound = potentialBuilder.build();
-            if (lastFound.isEmpty()) {
-                return Collections.emptyMap();
-            }
-        }
-        @SuppressWarnings({ "unchecked", "rawtypes" })
-        final Map<InstanceIdentifier<T>, T> result = (Map) lastFound;
-        return result;
-    }
-
-    @SuppressWarnings("rawtypes")
-    private static Map<InstanceIdentifier, InterfaceTyped> readData(final Entry<InstanceIdentifier, InterfaceTyped> entry,
-                                                                    final PathArgument pathArgument) {
-        return readData(entry.getValue(), entry.getKey(), pathArgument);
-    }
-
-    public static final <T extends TreeNode> Optional<T> readData(final TreeNode source, final Class<T> child) {
-        checkArgument(source != null, "Object should not be null.");
-        checkArgument(child != null, "Child type should not be null");
-        Class<? extends InterfaceTyped> parentClass = source.implementedInterface();
-
-        @SuppressWarnings("unchecked")
-        T potential = (T) resolveReadStrategy(parentClass, child).read(source, child);
-        return Optional.ofNullable(potential);
-    }
-
-    @SuppressWarnings("rawtypes")
-    private static final Map<InstanceIdentifier, InterfaceTyped> readData(final InterfaceTyped parent,
-                                                                          final InstanceIdentifier parentPath, final PathArgument child) {
-        checkArgument(parent != null, "Object should not be null.");
-        checkArgument(child != null, "Child argument should not be null");
-        Class<? extends InterfaceTyped> parentClass = parent.implementedInterface();
-        return resolveReadStrategy(parentClass, child.getType()).readUsingPathArgument(parent, child, parentPath);
-    }
-
-    private static DataObjectReadingStrategy resolveReadStrategy(final Class<? extends InterfaceTyped> parentClass,
-            final Class<? extends InterfaceTyped> type) {
-
-        DataObjectReadingStrategy strategy = createReadStrategy(parentClass, type);
-        // FIXME: Add caching of strategies
-        return strategy;
-    }
-
-    private static DataObjectReadingStrategy createReadStrategy(final Class<? extends InterfaceTyped> parent,
-            final Class<? extends InterfaceTyped> child) {
-
-        if (Augmentable.class.isAssignableFrom(parent) && Augmentation.class.isAssignableFrom(child)) {
-            return REAUSABLE_AUGMENTATION_READING_STRATEGY;
-        }
-
-        /*
-         * FIXME Ensure that this strategies also works for children of cases.
-         * Possible edge-case is : Parent container uses grouping foo case is
-         * added by augmentation also uses foo.
-         */
-        if (IdentifiableListItem.class.isAssignableFrom(child)) {
-            @SuppressWarnings("unchecked")
-            final Class<? extends IdentifiableListItem<?>> identifiableClass = (Class<? extends IdentifiableListItem<?>>) child;
-            return new ListItemReadingStrategy(parent, identifiableClass);
-        }
-        return new ContainerReadingStrategy(parent, child);
-    }
-
-    private static Method resolveGetterMethod(final Class<? extends InterfaceTyped> parent, final Class<?> child) {
-        String methodName = "get" + child.getSimpleName();
-        try {
-            return parent.getMethod(methodName);
-        } catch (NoSuchMethodException e) {
-            throw new IllegalArgumentException(e);
-        } catch (SecurityException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    @SuppressWarnings("rawtypes")
-    private static abstract class DataObjectReadingStrategy {
-
-        private final Class<? extends InterfaceTyped> parentType;
-        private final Class<? extends InterfaceTyped> childType;
-        private final Method getterMethod;
-
-        @SuppressWarnings("unchecked")
-        public DataObjectReadingStrategy(final Class parentType, final Class childType) {
-            checkArgument(InterfaceTyped.class.isAssignableFrom(parentType));
-            checkArgument(InterfaceTyped.class.isAssignableFrom(childType));
-            this.parentType = parentType;
-            this.childType = childType;
-            this.getterMethod = resolveGetterMethod(parentType, childType);
-        }
-
-        @SuppressWarnings("unchecked")
-        public DataObjectReadingStrategy(final Class parentType, final Class childType, final Method getter) {
-            this.parentType = parentType;
-            this.childType = childType;
-            this.getterMethod = getter;
-        }
-
-        @SuppressWarnings("unused")
-        protected Class<? extends InterfaceTyped> getParentType() {
-            return parentType;
-        }
-
-        protected Class<? extends InterfaceTyped> getChildType() {
-            return childType;
-        }
-
-        protected Method getGetterMethod() {
-            return getterMethod;
-        }
-
-        public abstract Map<InstanceIdentifier, InterfaceTyped> readUsingPathArgument(InterfaceTyped parent,
-                                                                                      PathArgument childArgument, InstanceIdentifier targetBuilder);
-
-        public abstract InterfaceTyped read(InterfaceTyped parent, Class<?> childType);
-
-    }
-
-    @SuppressWarnings("rawtypes")
-    private static class ContainerReadingStrategy extends DataObjectReadingStrategy {
-
-        public ContainerReadingStrategy(final Class<? extends InterfaceTyped> parent, final Class<? extends InterfaceTyped> child) {
-            super(parent, child);
-            checkArgument(child.isAssignableFrom(getGetterMethod().getReturnType()));
-        }
-
-        @Override
-        public Map<InstanceIdentifier, InterfaceTyped> readUsingPathArgument(final InterfaceTyped parent,
-                                                                             final PathArgument childArgument, final InstanceIdentifier parentPath) {
-            final InterfaceTyped result = read(parent, childArgument.getType());
-            if (result != null) {
-                @SuppressWarnings("unchecked")
-                InstanceIdentifier childPath = parentPath.child(childArgument.getType());
-                return Collections.singletonMap(childPath, result);
-            }
-            return Collections.emptyMap();
-        }
-
-        @Override
-        public InterfaceTyped read(final InterfaceTyped parent, final Class<?> childType) {
-            try {
-                Object potentialData = getGetterMethod().invoke(parent);
-                checkState(potentialData instanceof InterfaceTyped);
-                return (InterfaceTyped) potentialData;
-
-            } catch (IllegalAccessException | InvocationTargetException e) {
-                throw new IllegalArgumentException(e);
-            }
-        }
-    }
-
-    @SuppressWarnings("rawtypes")
-    private static class ListItemReadingStrategy extends DataObjectReadingStrategy {
-
-        public ListItemReadingStrategy(final Class<? extends InterfaceTyped> parent, final Class child) {
-            super(parent, child);
-            checkArgument(Iterable.class.isAssignableFrom(getGetterMethod().getReturnType()));
-        }
-
-        @Override
-        public InterfaceTyped read(final InterfaceTyped parent, final Class<?> childType) {
-            // This will always fail since we do not have key.
-            return null;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        public Map<InstanceIdentifier, InterfaceTyped> readUsingPathArgument(final InterfaceTyped parent,
-                                                                             final PathArgument childArgument, final InstanceIdentifier builder) {
-            try {
-                Object potentialList = getGetterMethod().invoke(parent);
-                if (potentialList instanceof Iterable) {
-
-                    final Iterable<IdentifiableListItem> dataList = (Iterable<IdentifiableListItem>) potentialList;
-                    if (childArgument instanceof IdentifiableItem<?, ?>) {
-                        return readUsingIdentifiableItem(dataList, (IdentifiableItem) childArgument, builder);
-                    } else {
-                        return readAll(dataList, builder);
-                    }
-                }
-            } catch (InvocationTargetException e) {
-                throw new IllegalStateException(e);
-            } catch (IllegalAccessException e) {
-                throw new IllegalStateException(e);
-            } catch (IllegalArgumentException e) {
-                throw new IllegalStateException(e);
-            }
-            return Collections.emptyMap();
-        }
-
-        private Map<InstanceIdentifier, InterfaceTyped> readAll(final Iterable<IdentifiableListItem> dataList,
-                                                                final InstanceIdentifier parentPath) {
-            Builder<InstanceIdentifier, InterfaceTyped> result = ImmutableMap
-                    .<InstanceIdentifier, InterfaceTyped> builder();
-            for (IdentifiableListItem item : dataList) {
-                @SuppressWarnings("unchecked")
-                InstanceIdentifier childPath = parentPath.child(getChildType(), item.identifier());
-                result.put(childPath, (InterfaceTyped) item);
-            }
-            return result.build();
-        }
-
-        @SuppressWarnings("unchecked")
-        private static Map<InstanceIdentifier, InterfaceTyped> readUsingIdentifiableItem(final Iterable<IdentifiableListItem> dataList,
-                                                                                         final IdentifiableItem childArgument, final InstanceIdentifier parentPath) {
-            final Identifier<?> key = childArgument.getKey();
-            for (IdentifiableListItem item : dataList) {
-                if (key.equals(item.identifier()) && item instanceof InterfaceTyped) {
-                    checkState(childArgument.getType().isInstance(item),
-                            "Found child is not instance of requested type");
-                    InstanceIdentifier childPath = parentPath
-                            .child(childArgument.getType(), item.identifier());
-                    return Collections.singletonMap(childPath, (InterfaceTyped) item);
-                }
-            }
-            return Collections.emptyMap();
-        }
-
-    }
-
-    private static final DataObjectReadingStrategy REAUSABLE_AUGMENTATION_READING_STRATEGY = new AugmentationReadingStrategy();
-
-    private static final class AugmentationReadingStrategy extends DataObjectReadingStrategy {
-
-        public AugmentationReadingStrategy() {
-            super(Augmentable.class, Augmentation.class, null);
-        }
-
-        @SuppressWarnings("rawtypes")
-        @Override
-        public Map<InstanceIdentifier, InterfaceTyped> readUsingPathArgument(final InterfaceTyped parent,
-                                                                             final PathArgument childArgument, final InstanceIdentifier builder) {
-            checkArgument(childArgument instanceof Item<?>, "Path Argument must be Item without keys");
-            InterfaceTyped aug = read(parent, childArgument.getType());
-            if (aug != null) {
-                @SuppressWarnings("unchecked")
-                final InstanceIdentifier childPath = builder.child(childArgument.getType());
-                return Collections.singletonMap(childPath, aug);
-            } else {
-                return Collections.emptyMap();
-            }
-        }
-
-        @Override
-        public InterfaceTyped read(final InterfaceTyped parent, final Class<?> childType) {
-            checkArgument(Augmentation.class.isAssignableFrom(childType), "Parent must be Augmentable.");
-            checkArgument(parent instanceof Augmentable<?>, "Parent must be Augmentable.");
-
-            @SuppressWarnings({ "rawtypes", "unchecked" })
-            Augmentation potential = ((Augmentable) parent).getAugmentation(childType);
-            checkState(potential instanceof InterfaceTyped, "Readed augmention must be data object");
-            return (InterfaceTyped) potential;
-        }
-    }
-
-    /**
-     * Create sublist view of child from element on [size-of-parent] position to
-     * last element.
-     *
-     * @param parent
-     * @param child
-     * @return sublist view of child argument
-     * @throws IllegalArgumentException
-     *             if parent argument is bigger than child
-     */
-    private static <P, C> List<C> subList(final Iterable<P> parent, final Iterable<C> child) {
-        Iterator<P> iParent = parent.iterator();
-        List<C> result = new ArrayList<>();
-        for (C arg : child) {
-            if (iParent.hasNext()) {
-                iParent.next();
-            } else {
-                result.add(arg);
-            }
-        }
-        if (iParent.hasNext()) {
-            throw new IllegalArgumentException("Parent argument is bigger than child.");
-        }
-        return result;
-    }
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/LocalNameRpcServiceInvoker.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/LocalNameRpcServiceInvoker.java
deleted file mode 100644 (file)
index f55f345..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.base.Preconditions;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-
-final class LocalNameRpcServiceInvoker extends AbstractMappedRpcInvoker<String> {
-    private final QNameModule module;
-
-    private LocalNameRpcServiceInvoker(final QNameModule module, final Map<String, Method> map) {
-        super(map);
-        this.module = Preconditions.checkNotNull(module);
-    }
-
-    static RpcServiceInvoker instanceFor(final QNameModule module, final Map<QName, Method> qnameToMethod) {
-        final Map<String, Method> map = new HashMap<>();
-        for (Entry<QName, Method> e : qnameToMethod.entrySet()) {
-            map.put(e.getKey().getLocalName(), e.getValue());
-        }
-
-        return new LocalNameRpcServiceInvoker(module, map);
-    }
-
-    @Override
-    protected String qnameToKey(final QName qname) {
-        if (module.equals(qname.getModule())) {
-            return qname.getLocalName();
-        } else {
-            return null;
-        }
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/NotificationListenerInvoker.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/NotificationListenerInvoker.java
deleted file mode 100644 (file)
index 38f3038..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.base.Preconditions;
-import com.google.common.base.Throwables;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodHandles.Lookup;
-import java.lang.invoke.MethodType;
-import java.lang.reflect.Method;
-import java.util.Map;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.yangtools.yang.binding.InterfaceTyped;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.opendaylight.yangtools.yang.common.QName;
-
-/**
- * Provides single method invocation of notificatoin callbacks on supplied instance.
- *
- * Notification Listener invoker provides common invocation interface for any subtype of {@link NotificationListener}.
- * via {@link #invokeNotification(NotificationListener, QName, InterfaceTyped)} method.
- *
- */
-public final class NotificationListenerInvoker {
-
-    private static final Lookup LOOKUP = MethodHandles.publicLookup();
-
-    private static final LoadingCache<Class<? extends NotificationListener>, NotificationListenerInvoker> INVOKERS = CacheBuilder
-            .newBuilder().weakKeys()
-            .build(new CacheLoader<Class<? extends NotificationListener>, NotificationListenerInvoker>() {
-
-                @Override
-                public NotificationListenerInvoker load(final Class<? extends NotificationListener> key) throws Exception {
-                    return createInvoker(key);
-                }
-
-            });
-
-    private final Map<QName, MethodHandle> methodInvokers;
-
-    public NotificationListenerInvoker(final Map<QName, MethodHandle> map) {
-        this.methodInvokers = map;
-    }
-
-    /**
-     *
-     * Creates RPCServiceInvoker for specified RpcService type
-     *
-     * @param type
-     *            RpcService interface, which was generated from model.
-     * @return Cached instance of {@link NotificationListenerInvoker} for
-     *         supplied RPC type.
-     *
-     */
-    public static NotificationListenerInvoker from(final Class<? extends NotificationListener> type) {
-        Preconditions.checkArgument(type.isInterface());
-        Preconditions.checkArgument(BindingReflections.isBindingClass(type));
-        return INVOKERS.getUnchecked(type);
-    }
-
-    /**
-     * Invokes supplied RPC on provided implementation of RPC Service.
-     *
-     * @param impl
-     *            Imlementation on which notifiaction callback should be
-     *            invoked.
-     * @param rpcName
-     *            Name of RPC to be invoked.
-     * @param input
-     *            Input data for RPC.
-     *
-     */
-    public void invokeNotification(@Nonnull final NotificationListener impl, @Nonnull final QName rpcName,
-            @Nullable final InterfaceTyped input) {
-        Preconditions.checkNotNull(impl, "implemetation must be supplied");
-        final MethodHandle invoker = methodInvokers.get(rpcName);
-        Preconditions.checkArgument(invoker != null, "Supplied notification is not valid for implementation %s", impl);
-        try {
-            invoker.invokeExact(impl, input);
-        } catch (final Throwable e) {
-            throw Throwables.propagate(e);
-        }
-    }
-
-    private static NotificationListenerInvoker createInvoker(final Class<? extends NotificationListener> key) {
-        return new NotificationListenerInvoker(createInvokerMap(key));
-    }
-
-    private static Map<QName, MethodHandle> createInvokerMap(final Class<? extends NotificationListener> key) {
-        final Builder<QName, MethodHandle> ret = ImmutableMap.<QName, MethodHandle>builder();
-        for (final Method method : key.getMethods()) {
-            if (BindingReflections.isNotificationCallback(method)) {
-
-                final Class<?> notification = method.getParameterTypes()[0];
-                final QName name = BindingReflections.findQName(notification);
-                MethodHandle handle;
-                try {
-                    handle = LOOKUP.unreflect(method).asType(
-                            MethodType.methodType(void.class, NotificationListener.class, InterfaceTyped.class));
-                    ret.put(name, handle);
-                } catch (final IllegalAccessException e) {
-                    throw new IllegalStateException("Can not access public method.", e);
-                }
-            }
-
-        }
-        return ret.build();
-    }
-
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/QNameRpcServiceInvoker.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/QNameRpcServiceInvoker.java
deleted file mode 100644 (file)
index 953e25d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-import org.opendaylight.yangtools.yang.common.QName;
-
-final class QNameRpcServiceInvoker extends AbstractMappedRpcInvoker<QName> {
-    private QNameRpcServiceInvoker(final Map<QName, Method> qnameToMethod) {
-        super(qnameToMethod);
-    }
-
-    static RpcServiceInvoker instanceFor(final Map<QName, Method> qnameToMethod) {
-        return new QNameRpcServiceInvoker(qnameToMethod);
-    }
-
-    @Override
-    protected QName qnameToKey(final QName qname) {
-        return qname;
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvoker.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvoker.java
deleted file mode 100644 (file)
index 6a25542..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import static com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.XmlToken.Optional;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodHandles.Lookup;
-import java.lang.reflect.Method;
-import java.util.Optional;
-import java.util.concurrent.Future;
-import org.opendaylight.yangtools.yang.binding.InterfaceTyped;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-abstract class RpcMethodInvoker {
-
-    private static final Lookup LOOKUP = MethodHandles.publicLookup();
-
-    protected abstract Future<RpcResult<?>> invokeOn(RpcService impl, TreeNode input);
-
-    protected static RpcMethodInvoker from(final Method method) {
-        Optional<Class<? extends InterfaceTyped>> input = BindingReflections.resolveRpcInputClass(method);
-        try {
-            MethodHandle methodHandle = LOOKUP.unreflect(method);
-            if (input.isPresent()) {
-                return new RpcMethodInvokerWithInput(methodHandle);
-            }
-            return new RpcMethodInvokerWithoutInput(methodHandle);
-        } catch (IllegalAccessException e) {
-            throw new IllegalStateException("Lookup on public method failed.",e);
-        }
-
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvokerWithInput.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvokerWithInput.java
deleted file mode 100644 (file)
index e2a6621..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.base.Throwables;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodType;
-import java.util.concurrent.Future;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-class RpcMethodInvokerWithInput extends RpcMethodInvoker {
-
-    private static final MethodType INVOCATION_SIGNATURE = MethodType.methodType(Future.class, RpcService.class,TreeNode.class);
-    private final MethodHandle handle;
-
-    RpcMethodInvokerWithInput(MethodHandle methodHandle) {
-        this.handle = methodHandle.asType(INVOCATION_SIGNATURE);
-    }
-
-    @Override
-    public Future<RpcResult<?>> invokeOn(RpcService impl, TreeNode input) {
-        try {
-            return (Future<RpcResult<?>>) handle.invokeExact(impl,input);
-        } catch (Throwable e) {
-            throw Throwables.propagate(e);
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvokerWithoutInput.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvokerWithoutInput.java
deleted file mode 100644 (file)
index a615eed..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.base.Throwables;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodType;
-import java.util.concurrent.Future;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-
-class RpcMethodInvokerWithoutInput extends RpcMethodInvoker {
-
-    private static final MethodType INVOCATION_SIGNATURE = MethodType.methodType(Future.class, RpcService.class);
-    private final MethodHandle handle;
-
-    RpcMethodInvokerWithoutInput(MethodHandle methodHandle) {
-        this.handle = methodHandle.asType(INVOCATION_SIGNATURE);
-    }
-
-    @Override
-    public Future<RpcResult<?>> invokeOn(RpcService impl, TreeNode input) {
-        try {
-            return (Future<RpcResult<?>>) handle.invokeExact(impl);
-        } catch (Throwable e) {
-            throw Throwables.propagate(e);
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcServiceInvoker.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcServiceInvoker.java
deleted file mode 100644 (file)
index aaf1914..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.base.Preconditions;
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.concurrent.Future;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Provides single method invocation of RPCs on supplied instance.
- *
- * Rpc Service invoker provides common invocation interface for any subtype of {@link RpcService}.
- * via {@link #invokeRpc(RpcService, QName, TreeNode)} method.
- */
-public abstract class RpcServiceInvoker {
-    private static final Logger LOG = LoggerFactory.getLogger(RpcServiceInvoker.class);
-
-    /**
-     * Creates RPCServiceInvoker for specified RpcService type
-     *
-     * @param type RpcService interface, which was generated from model.
-     * @return Cached instance of {@link RpcServiceInvoker} for supplied RPC type.
-     *
-     */
-    public static RpcServiceInvoker from(final Class<? extends RpcService> type) {
-        return ClassBasedRpcServiceInvoker.instanceFor(type);
-    }
-
-    /**
-     * Creates an RPCServiceInvoker for specified QName-&lt;Method mapping.
-     *
-     * @param qnameToMethod translation mapping, must not be null nor empty.
-     * @return An {@link RpcMethodInvoker} instance.
-     */
-    public static RpcServiceInvoker from(final Map<QName, Method> qnameToMethod) {
-        Preconditions.checkArgument(!qnameToMethod.isEmpty());
-        QNameModule module = null;
-
-        for (QName qname : qnameToMethod.keySet()) {
-            if (module != null) {
-                if (!module.equals(qname.getModule())) {
-                    LOG.debug("QNames from different modules {} and {}, falling back to QName map", module, qname.getModule());
-                    return QNameRpcServiceInvoker.instanceFor(qnameToMethod);
-                }
-            } else {
-                module = qname.getModule();
-            }
-        }
-
-        // All module are equal, which means we can use localName only
-        return LocalNameRpcServiceInvoker.instanceFor(module, qnameToMethod);
-    }
-
-    /**
-     * Invokes supplied RPC on provided implementation of RPC Service.
-     *
-     * @param impl Imlementation on which RPC should be invoked.
-     * @param rpcName Name of RPC to be invoked.
-     * @param input Input data for RPC.
-     * @return Future which will complete once rpc procesing is finished.
-     */
-    public abstract Future<RpcResult<?>> invokeRpc(@Nonnull final RpcService impl, @Nonnull final QName rpcName, @Nullable final TreeNode input);
-}
diff --git a/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/StringValueObjectFactory.java b/binding2/prototype/yang-binding2/src/main/java/org/opendaylight/yangtools/yang/binding/util/StringValueObjectFactory.java
deleted file mode 100644 (file)
index 0955681..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2016 Pantheon Technologies s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Throwables;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodHandles.Lookup;
-import java.lang.invoke.MethodType;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility class for instantiating value-type generated objects with String being the base type. Unlike the normal
- * constructor, instances of this class bypass string validation.
- *
- * THE USE OF THIS CLASS IS DANGEROUS AND SHOULD ONLY BE USED TO IMPLEMENT WELL-AUDITED AND CORRECT UTILITY METHODS
- * SHIPPED WITH MODELS TO PROVIDE INSTANTIATION FROM TYPES DIFFERENT THAN STRING.
- *
- * APPLICATION CODE <em>MUST NOT</em> USE THIS CLASS DIRECTLY. VIOLATING THIS CONSTRAINT HAS SECURITY AND CORRECTNESS
- * IMPLICATIONS ON EVERY USER INTERACTING WITH THE RESULTING OBJECTS.
- *
- * @param <T> Resulting object type
- */
-@Beta
-public final class StringValueObjectFactory<T> {
-    private static final MethodType CONSTRUCTOR_METHOD_TYPE = MethodType.methodType(Object.class, Object.class);
-    private static final MethodType SETTER_METHOD_TYPE = MethodType.methodType(void.class, Object.class, String.class);
-    private static final Logger LOG = LoggerFactory.getLogger(StringValueObjectFactory.class);
-    private static final Lookup LOOKUP = MethodHandles.lookup();
-
-    private final MethodHandle constructor;
-    private final MethodHandle setter;
-    private final T template;
-
-    private StringValueObjectFactory(final T template, final MethodHandle constructor, final MethodHandle setter) {
-        this.template = Preconditions.checkNotNull(template);
-        this.constructor = constructor.bindTo(template);
-        this.setter = Preconditions.checkNotNull(setter);
-    }
-
-    public static <T> StringValueObjectFactory<T> create(final Class<T> clazz, final String templateString) {
-        final Constructor<T> stringConstructor;
-        try {
-            stringConstructor = clazz.getConstructor(String.class);
-        } catch (NoSuchMethodException e) {
-            throw new IllegalArgumentException(String.format("%s does not have a String constructor", clazz), e);
-        }
-
-        final T template;
-        try {
-            template = stringConstructor.newInstance(templateString);
-        } catch (InstantiationException | InvocationTargetException | IllegalAccessException e) {
-            throw new IllegalArgumentException(String.format("Failed to instantiate template %s for '%s'", clazz,
-                templateString), e);
-        }
-
-        final Constructor<T> copyConstructor;
-        try {
-            copyConstructor = clazz.getConstructor(clazz);
-        } catch (NoSuchMethodException e) {
-            throw new IllegalArgumentException(String.format("%s does not have a copy constructor", clazz), e);
-        }
-
-        final Field f;
-        try {
-            f = clazz.getDeclaredField("_value");
-        } catch (NoSuchFieldException e) {
-            throw new IllegalArgumentException(String.format("%s does not have required internal field", clazz), e);
-        }
-        f.setAccessible(true);
-
-        final StringValueObjectFactory<T> ret;
-        try {
-            ret = new StringValueObjectFactory<>(template,
-                    LOOKUP.unreflectConstructor(copyConstructor).asType(CONSTRUCTOR_METHOD_TYPE),
-                    LOOKUP.unreflectSetter(f).asType(SETTER_METHOD_TYPE));
-        } catch (IllegalAccessException e) {
-            throw new IllegalStateException("Failed to instantiate method handles", e);
-        }
-
-        // Let us be very defensive and scream loudly if the invocation does not come from the same package. This
-        // is far from perfect, but better than nothing.
-        final Throwable t = new Throwable("Invocation stack");
-        t.fillInStackTrace();
-        if (matchesPackage(clazz.getPackage().getName(), t.getStackTrace())) {
-            LOG.info("Instantiated factory for {}", clazz);
-        } else {
-            LOG.warn("Instantiated factory for {} outside its package", clazz, t);
-        }
-
-        return ret;
-    }
-
-    private static boolean matchesPackage(final String pkg, final StackTraceElement[] stackTrace) {
-        for (StackTraceElement e : stackTrace) {
-            final String sp = e.getClassName();
-            if (sp.startsWith(pkg) && sp.lastIndexOf('.') == pkg.length()) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    public T newInstance(final String string) {
-        Preconditions.checkNotNull(string, "Argument may not be null");
-
-        try {
-            final T ret = (T) constructor.invokeExact();
-            setter.invokeExact(ret, string);
-            LOG.trace("Instantiated new object {} value {}", ret.getClass(), string);
-            return ret;
-        } catch (Throwable e) {
-            throw Throwables.propagate(e);
-        }
-    }
-
-    public T getTemplate() {
-        return template;
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifierTest.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifierTest.java
deleted file mode 100644 (file)
index 1373018..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import org.junit.Test;
-import org.opendaylight.yangtools.yang.binding.test.mock.FooChild;
-import org.opendaylight.yangtools.yang.binding.test.mock.InstantiatedFoo;
-import org.opendaylight.yangtools.yang.binding.test.mock.Node;
-import org.opendaylight.yangtools.yang.binding.test.mock.NodeChild;
-import org.opendaylight.yangtools.yang.binding.test.mock.NodeChildKey;
-import org.opendaylight.yangtools.yang.binding.test.mock.NodeKey;
-import org.opendaylight.yangtools.yang.binding.test.mock.Nodes;
-
-public class InstanceIdentifierTest {
-
-    @Test
-    public void constructWithPredicates() {
-
-        InstanceIdentifier<Nodes> nodes = InstanceIdentifier.builder(Nodes.class).build();
-
-        assertNotNull(nodes);
-        assertEquals(Nodes.class, nodes.getTargetType());
-
-
-        InstanceIdentifier<Node> node = nodes.builder().child(Node.class).build();
-
-        assertNotNull(node);
-        assertEquals(Node.class, node.getTargetType());
-
-        assertTrue(nodes.contains(node));
-    }
-
-    @Test
-    public void fluentConstruction() {
-
-        InstanceIdentifier<Nodes> nodes = InstanceIdentifier.builder(Nodes.class).build();
-        InstanceIdentifier<Node> node = InstanceIdentifier.builder(Nodes.class).child(Node.class,new NodeKey(10)).build();
-
-        assertNotNull(node);
-        assertEquals(Node.class, node.getTargetType());
-
-        assertTrue(nodes.contains(node));
-    }
-
-
-    @Test
-    public void negativeContains() {
-        InstanceIdentifier<FooChild> fooChild = InstanceIdentifier.builder(Nodes.class).child(InstantiatedFoo.class).child(FooChild.class).build();
-
-        InstanceIdentifier<Node> nodeTen = InstanceIdentifier.builder(Nodes.class) //
-                .child(Node.class,new NodeKey(10)).build();
-        InstanceIdentifier<Node> nodeOne = InstanceIdentifier.builder(Nodes.class) //
-                .child(Node.class,new NodeKey(1)).build();
-        InstanceIdentifier<Nodes> nodes = InstanceIdentifier.builder(Nodes.class).build();
-
-        assertFalse(fooChild.contains(nodeTen));
-        assertFalse(nodeTen.contains(nodes));
-
-        assertFalse(nodeOne.contains(nodes));
-        assertTrue(nodes.contains(nodeOne));
-
-        assertTrue(nodes.containsWildcarded(nodeOne));
-        assertFalse(nodeOne.containsWildcarded(nodes));
-    }
-
-    @Test
-    public void containsWildcarded() {
-        InstanceIdentifier<Nodes> nodes = InstanceIdentifier.builder(Nodes.class).build();
-        InstanceIdentifier<Node> wildcarded = InstanceIdentifier.builder(Nodes.class).child(Node.class).build();
-        InstanceIdentifier<NodeChild> wildcardedChildren = InstanceIdentifier.builder(Nodes.class) //
-                .child(Node.class) //
-                .child(NodeChild.class).build();
-
-        assertTrue(wildcarded.isWildcarded());
-        assertTrue(wildcardedChildren.isWildcarded());
-
-
-        InstanceIdentifier<Node> nodeTen = InstanceIdentifier.builder(Nodes.class) //
-                .child(Node.class,new NodeKey(10)).build();
-        InstanceIdentifier<Node> nodeOne = InstanceIdentifier.builder(Nodes.class) //
-                .child(Node.class,new NodeKey(1)).build();
-
-        assertFalse(nodeTen.isWildcarded());
-        assertFalse(nodeOne.isWildcarded());
-        assertTrue(nodes.containsWildcarded(nodeOne));
-        assertTrue(wildcarded.containsWildcarded(nodeOne));
-        assertTrue(wildcarded.containsWildcarded(nodeTen));
-
-
-        InstanceIdentifier<NodeChild> nodeTenChildWildcarded = InstanceIdentifier.builder(Nodes.class) //
-                .child(Node.class,new NodeKey(10)).child(NodeChild.class).build();
-
-        assertTrue(nodeTenChildWildcarded.isWildcarded());
-
-        InstanceIdentifier<NodeChild> nodeTenChild = InstanceIdentifier.builder(Nodes.class) //
-                .child(Node.class,new NodeKey(10)).child(NodeChild.class, new NodeChildKey(10)).build();
-        InstanceIdentifier<NodeChild> nodeOneChild = InstanceIdentifier.builder(Nodes.class) //
-                .child(Node.class,new NodeKey(1)).child(NodeChild.class, new NodeChildKey(1)).build();
-
-
-        assertFalse(nodeTenChildWildcarded.containsWildcarded(nodeOneChild));
-        assertTrue(nodeTenChildWildcarded.containsWildcarded(nodeTenChild));
-
-    }
-
-    void childOfTest() {
-        InstanceIdentifier.builder(Nodes.class).child(InstantiatedFoo.class).child(FooChild.class);
-    }
-
-    @Test
-    public void basicTests() {
-        InstanceIdentifier<TreeNode> instanceIdentifier1 = InstanceIdentifier.create(TreeNode.class);
-        InstanceIdentifier<TreeNode> instanceIdentifier2 = InstanceIdentifier.create(TreeNode.class);
-        Object object = new Object();
-
-        assertTrue(instanceIdentifier1.equals(instanceIdentifier1));
-        assertFalse(instanceIdentifier1.equals(null));
-        assertFalse(instanceIdentifier1.equals(object));
-        assertTrue(instanceIdentifier1.equals(instanceIdentifier2));
-
-        assertNotNull(instanceIdentifier1.hashCode());
-
-        assertNotNull(instanceIdentifier1.toString());
-    }
-
-    @Test
-    public void firstIdentifierOfTest() {
-        InstanceIdentifier<Node> instanceIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class,new NodeKey(10)).build();
-
-        InstanceIdentifier<Nodes> nodesIdentifier = instanceIdentifier.firstIdentifierOf(Nodes.class);
-        assertNotNull(nodesIdentifier);
-        InstanceIdentifier<TreeNode> dataObjectIdentifier = instanceIdentifier.firstIdentifierOf(TreeNode.class);
-        assertNull(dataObjectIdentifier);
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/FooChild.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/FooChild.java
deleted file mode 100644 (file)
index 1d71b3e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.test.mock;
-
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-
-public interface FooChild extends ChildTreeNode<GroupingFoo> {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/GroupingFoo.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/GroupingFoo.java
deleted file mode 100644 (file)
index ff85285..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.test.mock;
-
-public interface GroupingFoo {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/InstantiatedFoo.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/InstantiatedFoo.java
deleted file mode 100644 (file)
index f98bd27..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.test.mock;
-
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-
-public interface InstantiatedFoo extends TreeNode, GroupingFoo, ChildTreeNode<Nodes> {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Node.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Node.java
deleted file mode 100644 (file)
index 77efb70..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.test.mock;
-
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.IdentifiableListItem;
-
-public interface Node extends //
-        TreeNode, //
-        IdentifiableListItem<NodeKey>, //
-        ChildTreeNode<Nodes> {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChild.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChild.java
deleted file mode 100644 (file)
index ff79703..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.test.mock;
-
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.IdentifiableListItem;
-
-public interface NodeChild extends //
-        TreeNode, //
-        IdentifiableListItem<NodeChildKey>, //
-        ChildTreeNode<Node> {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChildKey.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChildKey.java
deleted file mode 100644 (file)
index 53d3a96..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.test.mock;
-
-import org.opendaylight.yangtools.yang.binding.Identifier;
-
-public class NodeChildKey implements //
-        Identifier<NodeChild> {
-    private static final long serialVersionUID = 1L;
-    private final int id;
-
-    public NodeChildKey(int id) {
-        this.id = id;
-    }
-
-    public int getId() {
-        return id;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + id;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        NodeChildKey other = (NodeChildKey) obj;
-        if (id != other.id)
-            return false;
-        return true;
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeKey.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeKey.java
deleted file mode 100644 (file)
index 1914d5d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.test.mock;
-
-import org.opendaylight.yangtools.yang.binding.Identifier;
-
-public class NodeKey implements //
-        Identifier<Node> {
-    private static final long serialVersionUID = 1L;
-    private final int id;
-
-    public NodeKey(int id) {
-        this.id = id;
-    }
-
-    public int getId() {
-        return id;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + id;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        NodeKey other = (NodeKey) obj;
-        if (id != other.id)
-            return false;
-        return true;
-    }
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Nodes.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Nodes.java
deleted file mode 100644 (file)
index 73e9b5d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.test.mock;
-
-import org.opendaylight.yangtools.yang.binding.ChildTreeNode;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.TreeRoot;
-
-public interface Nodes extends //
-        ChildTreeNode<TreeRoot>, //
-        TreeNode {
-
-}
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/util/BindingReflectionsTest.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/util/BindingReflectionsTest.java
deleted file mode 100644 (file)
index b2245e8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import org.junit.Test;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-
-import java.util.Collections;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class BindingReflectionsTest {
-
-    @Test
-    public void testBindingWithDummyObject() {
-        assertEquals("Package name should be equal to string", "org.opendaylight.yang.gen.v1.test.rev990939",
-                BindingReflections.getModelRootPackageName("org.opendaylight.yang.gen.v1.test.rev990939"));
-        assertEquals("ModuleInfoClassName should be equal to string", "test.$YangModuleInfoImpl",
-                BindingReflections.getModuleInfoClassName("test"));
-        assertEquals("Module info should be empty Set", Collections.EMPTY_SET,
-                BindingReflections.loadModuleInfos());
-        assertFalse("Should not be RpcType", BindingReflections.isRpcType(TreeNode.class));
-        assertFalse("Should not be AugmentationChild", BindingReflections.isAugmentationChild(TreeNode.class));
-        assertTrue("Should be BindingClass", BindingReflections.isBindingClass(TreeNode.class));
-        assertFalse("Should not be Notification", BindingReflections.isNotification(TreeNode.class));
-    }
-}
\ No newline at end of file
diff --git a/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/util/DataObjectReadingUtilTest.java b/binding2/prototype/yang-binding2/src/test/java/org/opendaylight/yangtools/yang/binding/util/DataObjectReadingUtilTest.java
deleted file mode 100644 (file)
index f9edd00..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.binding.util;
-
-import static com.sun.xml.internal.ws.dump.LoggingDumpTube.Position.Before;
-import static org.junit.Assert.assertTrue;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.UnmodifiableIterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.opendaylight.yangtools.yang.binding.TreeNode;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.test.mock.Nodes;
-
-public class DataObjectReadingUtilTest {
-    @Mock private InstanceIdentifier<? extends TreeNode> pathNull;
-    @Mock private Map.Entry<InstanceIdentifier<? extends TreeNode>, TreeNode> entryNull;
-    @Mock private TreeNode mockedTreeNode;
-    private InstanceIdentifier<? extends TreeNode> path;
-    private Map.Entry<InstanceIdentifier<? extends TreeNode>, TreeNode> entry;
-
-    @Before
-    public void setup() {
-        MockitoAnnotations.initMocks(this);
-
-        path = InstanceIdentifier.builder(Nodes.class).build();
-        ImmutableMap<InstanceIdentifier<? extends TreeNode>, TreeNode> map =
-                ImmutableMap.<InstanceIdentifier<? extends TreeNode>, TreeNode>builder()
-                .put(path, mockedTreeNode).build();
-
-        ImmutableSet<Entry<InstanceIdentifier<? extends TreeNode>, TreeNode>> entries = map.entrySet();
-        UnmodifiableIterator<Entry<InstanceIdentifier<? extends TreeNode>, TreeNode>> it = entries.iterator();
-        while(it.hasNext()) {
-            entry = it.next();
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test(expected = IllegalArgumentException.class)
-    public void testReadDataParentNull() {
-        DataObjectReadingUtil.readData(entryNull.getValue(), (InstanceIdentifier<TreeNode>) entryNull.getKey(), pathNull);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test(expected = IllegalArgumentException.class)
-    public void testReadDataParentPathNull() {
-        DataObjectReadingUtil.readData(entry.getValue(), (InstanceIdentifier<TreeNode>) entryNull.getKey(), pathNull);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Test
-    public void testReadDataWithThreeParams() {
-        assertTrue("Check if contains key",
-                DataObjectReadingUtil.readData(entry.getValue(),
-                        (InstanceIdentifier<TreeNode>) entry.getKey(), path).containsKey(entry.getKey()));
-
-        assertTrue("Check if contains value",
-                DataObjectReadingUtil.readData(entry.getValue(),
-                        (InstanceIdentifier<TreeNode>) entry.getKey(), path).containsValue(entry.getValue()));
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void testReadDataWithTwoParams() {
-        DataObjectReadingUtil.readData(mockedTreeNode, TreeNode.class);
-    }
-}
\ No newline at end of file