implement Event.equals()

This commit is contained in:
Felix 2017-03-22 22:17:28 +01:00
parent d9d7bebe54
commit c2adbc9c59
2 changed files with 10 additions and 0 deletions

View file

@ -274,6 +274,16 @@ public class Event extends SugarRecord implements Parcelable, Comparable<Event>
return getSlug().compareTo(event.getSlug());
}
@Override
public boolean equals(Object obj) {
if(obj instanceof Event){
return getGuid().equals(((Event)obj).getGuid());
} else {
return super.equals(obj);
}
}
public void update(Event e) {
if(!this.updatedAt.equals(e.getUpdatedAt())){
// TODO actually update