From: pmarguerite Date: Fri, 15 Dec 2006 15:07:30 +0000 (+0000) Subject: SessionHandle: added equals method to compare SessionHandles, based on the sessionUrn X-Git-Tag: Release_0.2~199 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c2df5603f3dd150ab8b8a60f08b0a688574c6388;p=vamsas.git SessionHandle: added equals method to compare SessionHandles, based on the sessionUrn git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@321 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/uk/ac/vamsas/client/SessionHandle.java b/src/uk/ac/vamsas/client/SessionHandle.java index b07e2be..3bd78c6 100644 --- a/src/uk/ac/vamsas/client/SessionHandle.java +++ b/src/uk/ac/vamsas/client/SessionHandle.java @@ -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())); + } + + }