Fixed SchemaPath resolution for base YANG types.
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / yang / model / util / Uint16.java
index 9db4ea9df878cdbc72da18ef30ebd431a99d0fdb..5764cb26c7bd0d616ac0ce9575d3fa9f752189c0 100644 (file)
@@ -26,15 +26,23 @@ public class Uint16 extends AbstractUnsignedInteger {
     private static final QName name = BaseTypes.constructQName("uint16");
     private Integer defaultValue = null;
     private static final String description = "uint16 represents integer values between 0 and 65535, inclusively.";
+    private final UnsignedIntegerTypeDefinition baseType;
+
+    private Uint16() {
+        super(name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+        this.baseType = this;
+    }
 
     public Uint16(final List<String> actualPath,
             final URI namespace, final Date revision) {
         super(actualPath, namespace, revision, name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+        this.baseType = new Uint16();
     }
 
     public Uint16(final List<String> actualPath,
             final URI namespace, final Date revision, final Integer defaultValue) {
         super(actualPath, namespace, revision, name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
+        this.baseType = new Uint16();
         this.defaultValue = defaultValue;
     }
 
@@ -42,6 +50,7 @@ public class Uint16 extends AbstractUnsignedInteger {
             final URI namespace, final Date revision, final List<RangeConstraint> rangeStatements,
             final String units, final Integer defaultValue) {
         super(actualPath, namespace, revision, name, description, rangeStatements, units);
+        this.baseType = new Uint16();
         this.defaultValue = defaultValue;
     }
 
@@ -53,7 +62,7 @@ public class Uint16 extends AbstractUnsignedInteger {
      */
     @Override
     public UnsignedIntegerTypeDefinition getBaseType() {
-        return this;
+        return baseType;
     }
 
     /*