Add method to set all albums of a Sone.
[Sone.git] / 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