Added more tests for yang parser. Updated current tests.
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / yang / model / util / Uint16.java
index 95b438b509f8258c722aa403ee64a8ac08985411..6cae33b8f5ae67614f6479b032de10a949f70ead 100644 (file)
@@ -7,11 +7,8 @@
  */
 package org.opendaylight.controller.yang.model.util;
 
-import java.util.List;
-
 import org.opendaylight.controller.yang.common.QName;
 import org.opendaylight.controller.yang.model.api.SchemaPath;
-import org.opendaylight.controller.yang.model.api.type.RangeConstraint;
 import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefinition;
 
 /**
@@ -21,33 +18,15 @@ import org.opendaylight.controller.yang.model.api.type.UnsignedIntegerTypeDefini
  *
  */
 public final class Uint16 extends AbstractUnsignedInteger {
-
+    public static final int MAX_VALUE = 65535;
     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 SchemaPath path) {
-        super(path, name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
-        this.baseType = new Uint16();
-    }
-
-    public Uint16(final SchemaPath path, final Integer defaultValue) {
-        super(path, name, description, Short.MIN_VALUE, Short.MAX_VALUE, "");
-        this.baseType = new Uint16();
-        this.defaultValue = defaultValue;
-    }
-
-    public Uint16(final SchemaPath path, final List<RangeConstraint> rangeStatements,
-            final String units, final Integer defaultValue) {
-        super(path, name, description, rangeStatements, units);
-        this.baseType = new Uint16();
-        this.defaultValue = defaultValue;
+        super(path, name, description, MAX_VALUE, "");
+        this.baseType = this;
     }
 
     /*
@@ -77,8 +56,7 @@ public final class Uint16 extends AbstractUnsignedInteger {
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
-        result = prime * result
-                + ((defaultValue == null) ? 0 : defaultValue.hashCode());
+        result = prime * result + ((defaultValue == null) ? 0 : defaultValue.hashCode());
         return result;
     }
 
@@ -114,4 +92,5 @@ public final class Uint16 extends AbstractUnsignedInteger {
         builder.append("]");
         return builder.toString();
     }
+
 }