diff --git a/apps/routerconsole/java/src/net/i2p/router/news/NewsEntry.java b/apps/routerconsole/java/src/net/i2p/router/news/NewsEntry.java index de6521b8099c32fd3fac69bce3b4377127c18e2d..39709144c1824ae3369d3c045505fd9d1fe30928 100644 --- a/apps/routerconsole/java/src/net/i2p/router/news/NewsEntry.java +++ b/apps/routerconsole/java/src/net/i2p/router/news/NewsEntry.java @@ -17,6 +17,7 @@ public class NewsEntry implements Comparable<NewsEntry> { public String authorName; // subnode of author /** reverse, newest first */ + @Override public int compareTo(NewsEntry e) { if (updated > e.updated) return -1; @@ -24,4 +25,22 @@ public class NewsEntry implements Comparable<NewsEntry> { return 1; return 0; } + + @Override + public boolean equals(Object o) { + if(o == null) { + return false; + } + if(!(o instanceof NewsEntry)) { + return false; + } + NewsEntry e = (NewsEntry) o; + + return this.compareTo(e) == 0; + } + + @Override + public int hashCode() { + return (int) updated; + } }