Added equals implementation to FeedComponent
fixes #488 Items of removed feed weren't properly removed from queue
This commit is contained in:
parent
dccbfea114
commit
bdc677bc76
|
@ -2,43 +2,43 @@ 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 {
|
||||||
|
|
||||||
protected long id;
|
protected long id;
|
||||||
|
|
||||||
public FeedComponent() {
|
public FeedComponent() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getId() {
|
public long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(long id) {
|
public void setId(long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Update this FeedComponent's attributes with the attributes from another
|
|
||||||
* FeedComponent. This method should only update attributes which where read from
|
|
||||||
* the feed.
|
|
||||||
*/
|
|
||||||
public void updateFromOther(FeedComponent other) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare's this FeedComponent's attribute values with another FeedComponent's
|
* Update this FeedComponent's attributes with the attributes from another
|
||||||
* attribute values. This method will only compare attributes which were
|
* FeedComponent. This method should only update attributes which where read from
|
||||||
* read from the feed.
|
* the feed.
|
||||||
*
|
*/
|
||||||
* @return true if attribute values are different, false otherwise
|
public void updateFromOther(FeedComponent other) {
|
||||||
*/
|
}
|
||||||
public boolean compareWithOther(FeedComponent other) {
|
|
||||||
return false;
|
/**
|
||||||
}
|
* Compare's this FeedComponent's attribute values with another FeedComponent's
|
||||||
|
* attribute values. This method will only compare attributes which were
|
||||||
|
* read from the feed.
|
||||||
|
*
|
||||||
|
* @return true if attribute values are different, false otherwise
|
||||||
|
*/
|
||||||
|
public boolean compareWithOther(FeedComponent other) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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));
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue