Test composite node with empty conts and lists to Json
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / structures / YangElement.java
index d10eb342c28e9be2998bb292fd024a592a6fce92..ed234582b8947b6400614b5d854323bc37049993 100644 (file)
@@ -6,7 +6,7 @@ public class YangElement {
     protected YangElement(String name) {
         this.name = name;
     }
-    
+
     public String getName() {
         return name;
     }
@@ -20,7 +20,11 @@ public class YangElement {
             return false;
         }
         YangElement yangElement = (YangElement) obj;
-        if (!this.name.equals(yangElement.name)) {
+        if (this.name == null) {
+            if (yangElement.name != null) {
+                return false;
+            }
+        } else if (!this.name.equals(yangElement.name)) {
             return false;
         }
         return true;