Add method that returns all Sones that like a given Reply.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 23 Oct 2010 11:23:52 +0000 (13:23 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 23 Oct 2010 11:23:52 +0000 (13:23 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java

index 8bf2cea..a3c8dc4 100644 (file)
@@ -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<Sone> getLikes(final Reply reply) {
+               return Filters.filteredSet(getSones(), new Filter<Sone>() {
+
+                       @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.
         *