From 4931b5d6e330389e2b694e1f894f3b17313d54e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 23 Oct 2010 13:23:52 +0200 Subject: [PATCH] Add method that returns all Sones that like a given Reply. --- src/main/java/net/pterodactylus/sone/core/Core.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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. * -- 2.7.4