X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FIdOnlySone.java;h=e06e5a7061e6a4252ea02030ffe148353dd47c26;hb=03cec6a6772c2d836d94864adddaf544cbe9d72f;hp=fa7aaced58ba56a92f735d5e6d6895f4bd692278;hpb=239f08e37721401290f43596e8a7e9aa83aae980;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java b/src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java
index fa7aace..e06e5a7 100644
--- a/src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java
+++ b/src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java
@@ -18,11 +18,11 @@ import net.pterodactylus.sone.freenet.wot.Identity;
import freenet.keys.FreenetURI;
+import com.google.common.base.Objects;
+
/**
* {@link Sone} implementation that only stores the ID of a Sone and returns
* {@code null}, {@code 0}, or empty collections where appropriate.
- *
- * @author David âBombeâ Roden
*/
public class IdOnlySone implements Sone {
@@ -126,16 +126,6 @@ public class IdOnlySone implements Sone {
}
@Override
- public Sone addFriend(String friendSone) {
- return this;
- }
-
- @Override
- public Sone removeFriend(String friendSoneId) {
- return this;
- }
-
- @Override
public List getPosts() {
return emptyList();
}
@@ -192,8 +182,7 @@ public class IdOnlySone implements Sone {
}
@Override
- public Sone removeLikedPostId(String postId) {
- return this;
+ public void removeLikedPostId(String postId) {
}
@Override
@@ -217,8 +206,7 @@ public class IdOnlySone implements Sone {
}
@Override
- public Sone removeLikedReplyId(String replyId) {
- return this;
+ public void removeLikedReplyId(String replyId) {
}
@Override
@@ -250,4 +238,14 @@ public class IdOnlySone implements Sone {
return id;
}
+ @Override
+ public int hashCode() {
+ return id.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ return (object != null) && (object.getClass() == getClass()) && Objects.equal(id, ((IdOnlySone) object).id);
+ }
+
}