implemented equals and hashCode
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user