implement Event.equals()

This commit is contained in:
Felix 2017-03-22 22:17:28 +01:00
parent cf87981d5f
commit d89fd0c36b
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()); 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) { public void update(Event e) {
if(!this.updatedAt.equals(e.getUpdatedAt())){ if(!this.updatedAt.equals(e.getUpdatedAt())){
// TODO actually update // TODO actually update