Add method to set all albums of a Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 10 Apr 2011 10:39:58 +0000 (12:39 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Apr 2011 04:40:07 +0000 (06:40 +0200)
src/main/java/net/pterodactylus/sone/data/Sone.java

index 30e10ad..4bd60cc 100644 (file)
@@ -605,6 +605,20 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
        }
 
        /**
+        * Sets the albums of this Sone.
+        *
+        * @param albums
+        *            The albums of this Sone
+        */
+       public synchronized void setAlbums(Collection<? extends Album> albums) {
+               Validation.begin().isNotNull("Albums", albums).check();
+               albums.clear();
+               for (Album album : albums) {
+                       addAlbum(album);
+               }
+       }
+
+       /**
         * Removes an album from this Sone.
         *
         * @param album