commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r239269 - /jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/TriggerEvent.java
Date Mon, 22 Aug 2005 22:50:25 GMT
Author: rahul
Date: Mon Aug 22 15:50:23 2005
New Revision: 239269

URL: http://svn.apache.org/viewcvs?rev=239269&view=rev
Log:
Needs toString() and hashCode() to go with equals(Object)

Modified:
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/TriggerEvent.java

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/TriggerEvent.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/TriggerEvent.java?rev=239269&r1=239268&r2=239269&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/TriggerEvent.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/TriggerEvent.java
Mon Aug 22 15:50:23 2005
@@ -124,9 +124,32 @@
                      || (payload != null && payload.equals(te2.payload)))) {
                 return true;
             }
-            return false;
         }
         return false;
+    }
+
+    /**
+     * Returns a string representation of this TriggerEvent object.
+     *
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        StringBuffer buf = new StringBuffer("TriggerEvent{name=");
+        buf.append(name).append(",type=").append(type);
+        if (payload != null) {
+            buf.append(",payload=").append(payload.toString());
+        }
+        buf.append("}");
+        return String.valueOf(buf);
+    }
+
+    /**
+     * Returns the hash code for this TriggerEvent object.
+     *
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode() {
+        return String.valueOf(this).hashCode();
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message