implemented equals and hashCode

This commit is contained in:
Mark Fisher
2010-03-05 22:33:24 +00:00
parent 590fd3bc5a
commit 0757df5b33
2 changed files with 18 additions and 0 deletions

View File

@@ -70,6 +70,15 @@ public class MessageHistory implements Iterable<MessageHistoryEvent>, Serializab
}
}
public boolean equals(Object other) {
return (other instanceof MessageHistory
&& this.events.equals(((MessageHistory) other).events));
}
public int hashCode() {
return 17 * this.events.hashCode();
}
/**
* Returns a String representation of the history event list.
*/

View File

@@ -103,6 +103,15 @@ public class ComponentMetadata implements Serializable {
return Collections.unmodifiableMap(this.attributes);
}
public boolean equals(Object other) {
return (other instanceof ComponentMetadata
&& this.attributes.equals(((ComponentMetadata) other).attributes));
}
public int hashCode() {
return 17 * this.attributes.hashCode();
}
public String toString() {
return this.attributes.toString();
}