]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/scl/CompileValueRequest.java
Add hashCode and equals to AbstractExpressionCompilationRequest
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / scl / CompileValueRequest.java
index 11f3ad1854b29e28dbc9724a7149d489b508e310..e0ed90a8977472ed5061c784e42f1c3e7519282b 100644 (file)
@@ -129,4 +129,36 @@ public class CompileValueRequest extends AbstractExpressionCompilationRequest<Co
             return null;
     }
 
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((literal == null) ? 0 : literal.hashCode());
+        result = prime * result + ((relation == null) ? 0 : relation.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;
+        CompileValueRequest other = (CompileValueRequest) obj;
+        if (literal == null) {
+            if (other.literal != null)
+                return false;
+        } else if (!literal.equals(other.literal))
+            return false;
+        if (relation == null) {
+            if (other.relation != null)
+                return false;
+        } else if (!relation.equals(other.relation))
+            return false;
+        return true;
+    }
+
+
 }