[ONOS-3902, ONOS-3903, ONOS-3904] string type, integer type derrived type
Change-Id: I8279e93fcb7dfb82491cc09057c9d75165add68d
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java b/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
index d005458..18653d2 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
@@ -51,10 +51,8 @@
*/
/**
* Leaf-list data represented in YANG.
- *
- * @param <T> YANG data type
*/
-public class YangLeafList<T> implements YangCommonInfo, Parsable {
+public class YangLeafList implements YangCommonInfo, Parsable {
/**
* Name of leaf-list.
@@ -73,6 +71,7 @@
/**
* Reference:RFC 6020.
+ *
* The "max-elements" statement, which is optional, takes as an argument a
* positive integer or the string "unbounded", which puts a constraint on
* valid list entries. A valid leaf-list or list always has at most
@@ -80,10 +79,11 @@
*
* If no "max-elements" statement is present, it defaults to "unbounded".
*/
- private int maxElelements;
+ private int maxElelements = Integer.MAX_VALUE;
/**
* Reference:RFC 6020.
+ *
* The "min-elements" statement, which is optional, takes as an argument a
* non-negative integer that puts a constraint on valid list entries. A
* valid leaf-list or list MUST have at least min-elements entries.
@@ -99,7 +99,7 @@
*
* o Otherwise, it is enforced if the ancestor node exists.
*/
- private int minElements;
+ private int minElements = 0;
/**
* The textual reference to this leaf-list.
@@ -109,7 +109,7 @@
/**
* Status of the leaf-list in the YANG definition.
*/
- private YangStatusType status;
+ private YangStatusType status = YangStatusType.CURRENT;
/**
* Textual units.
@@ -119,7 +119,7 @@
/**
* Data type of leaf-list.
*/
- private YangType<T> dataType;
+ private YangType<?> dataType;
/**
* Default Constructor to create a YANG leaf-list.
@@ -142,7 +142,7 @@
* @param leafListName the leaf-list name to set.
*/
public void setLeafName(String leafListName) {
- this.name = leafListName;
+ name = leafListName;
}
/**
@@ -168,6 +168,7 @@
*
* @return the description.
*/
+ @Override
public String getDescription() {
return description;
}
@@ -177,6 +178,7 @@
*
* @param description set the description.
*/
+ @Override
public void setDescription(String description) {
this.description = description;
}
@@ -222,6 +224,7 @@
*
* @return the reference.
*/
+ @Override
public String getReference() {
return reference;
}
@@ -231,6 +234,7 @@
*
* @param reference the reference to set.
*/
+ @Override
public void setReference(String reference) {
this.reference = reference;
}
@@ -240,6 +244,7 @@
*
* @return the status.
*/
+ @Override
public YangStatusType getStatus() {
return status;
}
@@ -249,6 +254,7 @@
*
* @param status the status to set.
*/
+ @Override
public void setStatus(YangStatusType status) {
this.status = status;
}
@@ -276,7 +282,7 @@
*
* @return the data type.
*/
- public YangType<T> getDataType() {
+ public YangType<?> getDataType() {
return dataType;
}
@@ -285,7 +291,7 @@
*
* @param dataType the data type to set.
*/
- public void setDataType(YangType<T> dataType) {
+ public void setDataType(YangType<?> dataType) {
this.dataType = dataType;
}
@@ -294,6 +300,7 @@
*
* @return returns LEAF_LIST_DATA.
*/
+ @Override
public ParsableDataType getParsableDataType() {
return ParsableDataType.LEAF_LIST_DATA;
}
@@ -303,6 +310,7 @@
*
* @throws DataModelException a violation of data model rules.
*/
+ @Override
public void validateDataOnEntry() throws DataModelException {
// TODO auto-generated method stub, to be implemented by parser
@@ -313,6 +321,7 @@
*
* @throws DataModelException a violation of data model rules.
*/
+ @Override
public void validateDataOnExit() throws DataModelException {
// TODO auto-generated method stub, to be implemented by parser