Refactored parsing of YANG uses statement.
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / yang / model / util / ExtendedType.java
index e5ef2026f17e9bb200dec87cecad2d70baeed396..b9729102c90b3b8d05a15f1380e5567d6663d802 100644 (file)
@@ -38,6 +38,7 @@ public class ExtendedType implements TypeDefinition<TypeDefinition<?>> {
     private Status status;
     private String units;
     private Object defaultValue;
+    private boolean addedByUses;
 
     public static class Builder {
         private final QName typeName;
@@ -52,6 +53,7 @@ public class ExtendedType implements TypeDefinition<TypeDefinition<?>> {
         private Status status = Status.CURRENT;
         private String units = "";
         private Object defaultValue = null;
+        private boolean addedByUses;
 
         private List<RangeConstraint> ranges = Collections.emptyList();
         private List<LengthConstraint> lengths = Collections.emptyList();
@@ -94,6 +96,11 @@ public class ExtendedType implements TypeDefinition<TypeDefinition<?>> {
             return this;
         }
 
+        public Builder addedByUses(final boolean addedByUses) {
+            this.addedByUses = addedByUses;
+            return this;
+        }
+
         public Builder unknownSchemaNodes(
                 final List<UnknownSchemaNode> unknownSchemaNodes) {
             this.unknownSchemaNodes = unknownSchemaNodes;
@@ -141,6 +148,7 @@ public class ExtendedType implements TypeDefinition<TypeDefinition<?>> {
         this.status = builder.status;
         this.units = builder.units;
         this.defaultValue = builder.defaultValue;
+        this.addedByUses = builder.addedByUses;
 
         this.ranges = builder.ranges;
         this.lengths = builder.lengths;
@@ -163,6 +171,10 @@ public class ExtendedType implements TypeDefinition<TypeDefinition<?>> {
         return defaultValue;
     }
 
+    public boolean isAddedByUses() {
+        return addedByUses;
+    }
+
     @Override
     public QName getQName() {
         return typeName;