X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FIdOnlySone.java;h=e06e5a7061e6a4252ea02030ffe148353dd47c26;hp=0ef220b951f25cc5ec70911c3417ed794c517464;hb=62573c314957b1851f4fbe693b8746686caa940a;hpb=2524f4d47c56874a263f9e53ec5c4035f2baa7e0 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 0ef220b..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 { @@ -182,8 +182,7 @@ public class IdOnlySone implements Sone { } @Override - public Sone removeLikedPostId(String postId) { - return this; + public void removeLikedPostId(String postId) { } @Override @@ -207,8 +206,7 @@ public class IdOnlySone implements Sone { } @Override - public Sone removeLikedReplyId(String replyId) { - return this; + public void removeLikedReplyId(String replyId) { } @Override @@ -240,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); + } + }