natros / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 2 forks source link

Enhancement: Override equals() and hashCode() #126

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Description of the new feature:
Need to be able to compare appointments.

Use Case:
Appointments are cloned when they are sent within an event. Need a way to find 
that particular appointment in a collection maintained in a HashMap elsewhere 
in my code. The cloned appointment is not equal to any appointments in the 
HashMap since it returns a different hashCode.

Patch is attached.

Thank you,

Original issue reported on code.google.com by mma...@gmail.com on 17 Aug 2011 at 8:06

Attachments:

GoogleCodeExporter commented 8 years ago
To me the Attendees, "Created By" and "All Day" values should be also part of 
both the HashCode and the equals methods.

Also, if you're using a HashMap to store your Appointments, you can use the ID 
as a unique identifier and help you to detect duplicates, can't you?

Looking forward for your comments

Original comment by ctasada on 19 Dec 2011 at 9:43

GoogleCodeExporter commented 8 years ago
You're right.

Original comment by mma...@gmail.com on 25 Apr 2012 at 11:55

GoogleCodeExporter commented 8 years ago
Can you apply an updated patch? I'll be happy to include it in the next version.

Thanks

Original comment by ctasada on 25 Apr 2012 at 9:48

GoogleCodeExporter commented 8 years ago
Done in r412

Original comment by ctasada on 1 Jun 2012 at 8:58