]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ResourceX.java
Playground for Antti.
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / ResourceX.java
diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ResourceX.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ResourceX.java
new file mode 100644 (file)
index 0000000..db3bd01
--- /dev/null
@@ -0,0 +1,33 @@
+package org.simantics.db.layer0.variable;
+
+import org.simantics.db.Resource;
+
+public class ResourceX implements VariableOrResource {
+    
+    public final Resource value;
+
+    public ResourceX(Resource value) {
+        this.value = value;
+    }
+    
+    @Override
+    public String toString() {
+        return "ResourceX " + value;
+    }
+    
+    @Override
+    public boolean equals(Object obj) {
+        if(this == obj)
+            return true;
+        if(obj == null || obj.getClass() != getClass())
+            return false;
+        ResourceX other = (ResourceX)obj;
+        return value == null ? other.value == null : value.equals(other.value);
+    }
+    
+    @Override
+    public int hashCode() {
+        return 31 * (value == null ? 0 : value.hashCode()) + 13532;
+    }
+    
+}