Test for class RefineHolder.java
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / api / AbstractSchemaNodeBuilder.java
index 439a3b9a1b9b7205371ba97ac7a8d2c10744450a..1a1b6b8d4cbbce321de77146ebb4e7cf179b29e4 100644 (file)
@@ -30,6 +30,47 @@ public abstract class AbstractSchemaNodeBuilder extends AbstractBuilder implemen
         this.qname = qname;\r
     }\r
 \r
+    @Override\r
+    public int hashCode() {\r
+        final int prime = 31;\r
+        int result = super.hashCode();\r
+        result = prime * result + ((parent == null) ? 0 : parent.hashCode());\r
+        result = prime * result + ((schemaPath == null) ? 0 : schemaPath.hashCode());\r
+        return result;\r
+    }\r
+\r
+    @Override\r
+    public boolean equals(Object obj) {\r
+        if (this == obj) {\r
+            return true;\r
+        }\r
+        if (obj == null) {\r
+            return false;\r
+        }\r
+        if (getClass() != obj.getClass()) {\r
+            return false;\r
+        }\r
+        if (!super.equals(obj)) {\r
+            return false;\r
+        }\r
+        AbstractSchemaNodeBuilder other = (AbstractSchemaNodeBuilder) obj;\r
+        if (parent == null) {\r
+            if (other.parent != null) {\r
+                return false;\r
+            }\r
+        } else if (!parent.equals(other.parent)) {\r
+            return false;\r
+        }\r
+        if (schemaPath == null) {\r
+            if (other.schemaPath != null) {\r
+                return false;\r
+            }\r
+        } else if (!schemaPath.equals(other.schemaPath)) {\r
+            return false;\r
+        }\r
+        return true;\r
+    }\r
+\r
     public QName getQName() {\r
         return qname;\r
     }\r