Minor code refactoring.
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / impl / UnknownSchemaNodeBuilder.java
index f18206973667bdcfdebbc7973df03bd3475013ed..64e35abed830e21f8a66ce2cef9e57f230fa36b4 100644 (file)
@@ -34,6 +34,60 @@ public final class UnknownSchemaNodeBuilder extends AbstractSchemaNodeBuilder {
         instance = new UnknownSchemaNodeImpl(qname);
     }
 
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((qname == null) ? 0 : qname.hashCode());
+        result = prime * result + ((schemaPath == null) ? 0 : schemaPath.hashCode());
+        result = prime * result + ((nodeType == null) ? 0 : nodeType.hashCode());
+        result = prime * result + ((nodeParameter == null) ? 0 : nodeParameter.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        UnknownSchemaNodeBuilder other = (UnknownSchemaNodeBuilder) obj;
+        if (qname == null) {
+            if (other.qname != null) {
+                return false;
+            }
+        } else if (!qname.equals(other.qname)) {
+            return false;
+        }
+        if (schemaPath == null) {
+            if (other.schemaPath != null) {
+                return false;
+            }
+        } else if (!schemaPath.equals(other.schemaPath)) {
+            return false;
+        }
+        if (nodeType == null) {
+            if (other.nodeType != null) {
+                return false;
+            }
+        } else if (!nodeType.equals(other.nodeType)) {
+            return false;
+        }
+        if (nodeParameter == null) {
+            if (other.nodeParameter != null) {
+                return false;
+            }
+        } else if (!nodeParameter.equals(other.nodeParameter)) {
+            return false;
+        }
+        return true;
+    }
+
     @Override
     public UnknownSchemaNode build() {
         if (!isBuilt) {
@@ -241,6 +295,61 @@ public final class UnknownSchemaNodeBuilder extends AbstractSchemaNodeBuilder {
             sb.append(nodeParameter);
             return sb.toString();
         }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((qname == null) ? 0 : qname.hashCode());
+            result = prime * result + ((schemaPath == null) ? 0 : schemaPath.hashCode());
+            result = prime * result + ((nodeType == null) ? 0 : nodeType.hashCode());
+            result = prime * result + ((nodeParameter == null) ? 0 : nodeParameter.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj == null) {
+                return false;
+            }
+            if (getClass() != obj.getClass()) {
+                return false;
+            }
+            UnknownSchemaNodeImpl other = (UnknownSchemaNodeImpl) obj;
+            if (qname == null) {
+                if (other.qname != null) {
+                    return false;
+                }
+            } else if (!qname.equals(other.qname)) {
+                return false;
+            }
+            if (path == null) {
+                if (other.path != null) {
+                    return false;
+                }
+            } else if (!path.equals(other.path)) {
+                return false;
+            }
+            if (nodeType == null) {
+                if (other.nodeType != null) {
+                    return false;
+                }
+            } else if (!nodeType.equals(other.nodeType)) {
+                return false;
+            }
+            if (nodeParameter == null) {
+                if (other.nodeParameter != null) {
+                    return false;
+                }
+            } else if (!nodeParameter.equals(other.nodeParameter)) {
+                return false;
+            }
+            return true;
+        }
+
     }
 
 }