Added equals implementation to FeedComponent

fixes #488

Items of removed feed weren't properly removed from queue
This commit is contained in:
daniel oeh 2014-08-11 20:43:05 +02:00
parent dccbfea114
commit bdc677bc76
1 changed files with 45 additions and 29 deletions

View File

@ -2,8 +2,8 @@ package de.danoeh.antennapod.feed;
/** /**
* Represents every possible component of a feed * Represents every possible component of a feed
* @author daniel
* *
* @author daniel
*/ */
public abstract class FeedComponent { public abstract class FeedComponent {
@ -47,4 +47,20 @@ public abstract class FeedComponent {
*/ */
public abstract String getHumanReadableIdentifier(); public abstract String getHumanReadableIdentifier();
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FeedComponent that = (FeedComponent) o;
if (id != that.id) return false;
return true;
}
@Override
public int hashCode() {
return (int) (id ^ (id >>> 32));
}
} }