From: David ‘Bombe’ Roden Date: Sat, 23 Oct 2010 11:23:52 +0000 (+0200) Subject: Add method that returns all Sones that like a given Reply. X-Git-Tag: 0.1-RC1~63 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=4931b5d6e330389e2b694e1f894f3b17313d54e2 Add method that returns all Sones that like a given Reply. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 8bf2cea..a3c8dc4 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -540,6 +540,23 @@ public class Core extends AbstractService { } /** + * Gets all Sones that like the given reply. + * + * @param reply + * The reply to check for + * @return All Sones that like the reply + */ + public Set getLikes(final Reply reply) { + return Filters.filteredSet(getSones(), new Filter() { + + @Override + public boolean filterObject(Sone sone) { + return sone.isLikedReplyId(reply.getId()); + } + }); + } + + /** * Deletes the given reply. It is removed from its Sone and from the reply * cache. *