From c2df5603f3dd150ab8b8a60f08b0a688574c6388 Mon Sep 17 00:00:00 2001 From: pmarguerite Date: Fri, 15 Dec 2006 15:07:30 +0000 Subject: [PATCH] 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 --- src/uk/ac/vamsas/client/SessionHandle.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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())); + } + + } -- 1.7.10.2