X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fruntime%2Feither%2FRight.java;fp=bundles%2Forg.simantics.scl.runtime%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fruntime%2Feither%2FRight.java;h=27aeec914111f5ee40971e78022037231000a74c;hp=0000000000000000000000000000000000000000;hb=5b1f5568f25146b397bcdb7b570ddad74246969f;hpb=564cbf99b9cc2cd4ce3a645c206c9742d8123035 diff --git a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/either/Right.java b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/either/Right.java new file mode 100644 index 000000000..27aeec914 --- /dev/null +++ b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/either/Right.java @@ -0,0 +1,29 @@ +package org.simantics.scl.runtime.either; + +public class Right implements Either { + public final Object value; + + public Right(Object value) { + this.value = value; + } + + @Override + public String toString() { + return "Right " + value; + } + + @Override + public boolean equals(Object obj) { + if(this == obj) + return true; + if(obj == null || obj.getClass() != getClass()) + return false; + Right other = (Right)obj; + return value == null ? other.value == null : value.equals(other.value); + } + + @Override + public int hashCode() { + return 31 * (value == null ? 0 : value.hashCode()) + 13533; + } +}