]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural2/src/org/simantics/structural2/scl/CompileProceduralExpressionValueRequest.java
Add hashCode and equals to AbstractExpressionCompilationRequest
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / scl / CompileProceduralExpressionValueRequest.java
index d9ce13d5969c653a3932c486ea2dc3009b21fa8b..b402520d74cbe0bb5487e2d96ed15c35c8196af6 100644 (file)
@@ -59,4 +59,42 @@ public class CompileProceduralExpressionValueRequest extends AbstractCompileStru
        return componentType;
     }
 
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((componentType == null) ? 0 : componentType.hashCode());
+        result = prime * result + ((expression == null) ? 0 : expression.hashCode());
+        result = prime * result + ((indexRoot == null) ? 0 : indexRoot.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;
+        CompileProceduralExpressionValueRequest other = (CompileProceduralExpressionValueRequest) obj;
+        if (componentType == null) {
+            if (other.componentType != null)
+                return false;
+        } else if (!componentType.equals(other.componentType))
+            return false;
+        if (expression == null) {
+            if (other.expression != null)
+                return false;
+        } else if (!expression.equals(other.expression))
+            return false;
+        if (indexRoot == null) {
+            if (other.indexRoot != null)
+                return false;
+        } else if (!indexRoot.equals(other.indexRoot))
+            return false;
+        return true;
+    }
+
+    
 }