X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=9d7ca826421ee9afcc64090e2d6b1e1a32734b33;hp=ca970c2b3dca4b8e1eb5caec56446e1d79011c4a;hb=63df577f7ced52acfa93e4a7f329292069d8ba9d;hpb=2b6349abcc3380869532b4fab01f7cff9d3c2ac3 diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index ca970c2..9d7ca82 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -115,6 +115,15 @@ public class Sone implements Fingerprintable, Comparable { }; + /** Filter that matches Sones that have at least one album. */ + public static final Filter HAS_ALBUM_FILTER = new Filter() { + + @Override + public boolean filterObject(Sone sone) { + return !sone.getAlbums().isEmpty(); + } + }; + /** The logger. */ private static final Logger logger = Logging.getLogger(Sone.class); @@ -138,7 +147,7 @@ public class Sone implements Fingerprintable, Comparable { private volatile long time; /** The profile of this Sone. */ - private volatile Profile profile = new Profile(); + private volatile Profile profile = new Profile(this); /** The client used by the Sone. */ private volatile Client client; @@ -380,19 +389,6 @@ public class Sone implements Fingerprintable, Comparable { } /** - * Sets all friends of this Sone at once. - * - * @param friends - * The new (and only) friends of this Sone - * @return This Sone (for method chaining) - */ - public Sone setFriends(Collection friends) { - friendSones.clear(); - friendSones.addAll(friends); - return this; - } - - /** * Returns whether this Sone has the given Sone as a friend Sone. * * @param friendSoneId