Author: manik.surtani(a)jboss.com
Date: 2008-06-03 07:10:06 -0400 (Tue, 03 Jun 2008)
New Revision: 5937
Modified:
core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
Log:
equals() and hashcode()
Modified: core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionImpl.java 2008-06-03 10:48:44 UTC (rev
5936)
+++ core/trunk/src/main/java/org/jboss/cache/RegionImpl.java 2008-06-03 11:10:06 UTC (rev
5937)
@@ -157,6 +157,25 @@
return getFqn().compareTo(other.getFqn());
}
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ RegionImpl region = (RegionImpl) o;
+
+ if (fqn != null ? !fqn.equals(region.fqn) : region.fqn != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return (fqn != null ? fqn.hashCode() : 0);
+ }
+
public void putNodeEvent(EvictedEventNode event)
{
try