[jboss-cvs] JBossAS SVN: r59442 - trunk/ejb3/src/test/org/jboss/ejb3/test/clusteredsession.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 9 12:58:18 EST 2007
Author: bstansberry at jboss.com
Date: 2007-01-09 12:58:17 -0500 (Tue, 09 Jan 2007)
New Revision: 59442
Modified:
trunk/ejb3/src/test/org/jboss/ejb3/test/clusteredsession/NodeAnswer.java
Log:
Implement equals and hashcode
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/clusteredsession/NodeAnswer.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/clusteredsession/NodeAnswer.java 2007-01-09 17:20:09 UTC (rev 59441)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/clusteredsession/NodeAnswer.java 2007-01-09 17:58:17 UTC (rev 59442)
@@ -35,6 +35,29 @@
return this.answer;
}
+ @Override
+ public boolean equals(Object obj)
+ {
+ boolean same = (this == obj);
+
+ if (!same && obj instanceof NodeAnswer)
+ {
+ NodeAnswer other = (NodeAnswer) obj;
+ same = this.nodeId.equals(other.nodeId)
+ && this.answer.equals(other.answer);
+ }
+ return same;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = 17;
+ result = result * 29 + nodeId.hashCode();
+ result = result * 29 + answer.hashCode();
+ return result;
+ }
+
public String toString ()
{
return "{ " + this.nodeId + " ; " + this.answer + " }";
More information about the jboss-cvs-commits
mailing list