SessionHandle: added equals method to compare SessionHandles, based on the sessionUrn
authorpmarguerite <pmarguerite@issues.jalview.org>
Fri, 15 Dec 2006 15:07:30 +0000 (15:07 +0000)
committerpmarguerite <pmarguerite@issues.jalview.org>
Fri, 15 Dec 2006 15:07:30 +0000 (15:07 +0000)
git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@321 be28352e-c001-0410-b1a7-c7978e42abec

src/uk/ac/vamsas/client/SessionHandle.java

index b07e2be..3bd78c6 100644 (file)
@@ -36,5 +36,21 @@ public class SessionHandle implements Serializable {
    * The path to the vamsas session file.
    */
   String sessionUrn = null;
+  
+  /**
+   * @see java.lang.Object#equals(java.lang.Object)
+   */
+  public boolean equals(Object obj) {
+
+    if (obj instanceof SessionHandle)
+      return this.equals((SessionHandle) obj); 
+    return false;
+  }
 
+  public boolean equals(SessionHandle that) {
+    return (this.sessionUrn.equals(that.getSessionUrn()));
+  }
+  
+  
 }