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 / AbstractSignedInteger.java
index 3907cc13e5d4bc314619885644935a9a74875ced..c2ae7d304a8c1ca9bae54b109e94f3b46d023ef4 100644 (file)
@@ -46,6 +46,20 @@ public abstract class AbstractSignedInteger implements IntegerTypeDefinition {
     private final String units;
     private final List<RangeConstraint> rangeStatements;
 
+    protected AbstractSignedInteger(final QName name, final String description,
+            final Number minRange, final Number maxRange, final String units) {
+        this.name = name;
+        this.description = description;
+        this.path = BaseTypes.schemaPath(name);
+        this.units = units;
+        this.rangeStatements = new ArrayList<RangeConstraint>();
+        final String rangeDescription = "Integer values between " + minRange
+                + " and " + maxRange + ", inclusively.";
+        this.rangeStatements.add(BaseConstraints.rangeConstraint(minRange,
+                maxRange, rangeDescription,
+                "https://tools.ietf.org/html/rfc6020#section-9.2.4"));
+    }
+
     /**
      * @param name
      * @param description