]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/either/Right.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.scl.runtime / src / org / simantics / scl / runtime / either / Right.java
1 package org.simantics.scl.runtime.either;
2
3 public class Right implements Either {
4     public final Object value;
5
6     public Right(Object value) {
7         this.value = value;
8     }
9     
10     @Override
11     public String toString() {
12         return "Right " + value;
13     }
14     
15     @Override
16     public boolean equals(Object obj) {
17         if(this == obj)
18             return true;
19         if(obj == null || obj.getClass() != getClass())
20             return false;
21         Right other = (Right)obj;
22         return value == null ? other.value == null : value.equals(other.value);
23     }
24     
25     @Override
26     public int hashCode() {
27         return 31 * (value == null ? 0 : value.hashCode()) + 13533;
28     }
29 }