Add filter for Sones with at least one album.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 15 Nov 2011 05:52:01 +0000 (06:52 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 15 Nov 2011 05:52:01 +0000 (06:52 +0100)
src/main/java/net/pterodactylus/sone/data/Sone.java

index 006765a..8b2ec2a 100644 (file)
@@ -115,6 +115,15 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
 
        };
 
+       /** Filter that matches Sones that have at least one album. */
+       public static final Filter<Sone> HAS_ALBUM_FILTER = new Filter<Sone>() {
+
+               @Override
+               public boolean filterObject(Sone sone) {
+                       return !sone.getAlbums().isEmpty();
+               }
+       };
+
        /** The logger. */
        private static final Logger logger = Logging.getLogger(Sone.class);