1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-29 12:05:53 +01:00

Implement hashCode() as equals has been implemented.

This commit is contained in:
Daniele Gobbetti 2017-04-17 21:07:50 +02:00
parent 1e231e6129
commit 7b50ba9572

View File

@ -156,7 +156,8 @@ public class CalendarEvents {
return calName;
}
@Override public boolean equals(Object other) {
@Override
public boolean equals(Object other) {
if (other instanceof CalendarEvent) {
CalendarEvent e = (CalendarEvent) other;
return (this.getId() == e.getId()) &&
@ -170,5 +171,17 @@ public class CalendarEvents {
return false;
}
}
@Override
public int hashCode() {
int result = (int) id;
result = 31 * result + title.hashCode();
result = 31 * result + Long.valueOf(begin).hashCode();
result = 31 * result + location.hashCode();
result = 31 * result + description.hashCode();
result = 31 * result + Long.valueOf(end).hashCode();
result = 31 * result + calName.hashCode();
return result;
}
}
}