Add method to set all albums of a Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 23bbb3e..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
@@ -657,11 +671,11 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
                }
                fingerprint.append(')');
 
-               fingerprint.append("Albums(");
-               for (Album album : albums) {
-                       fingerprint.append(album.getFingerprint());
-               }
-               fingerprint.append(')');
+//             fingerprint.append("Albums(");
+//             for (Album album : albums) {
+//                     fingerprint.append(album.getFingerprint());
+//             }
+//             fingerprint.append(')');
 
                return fingerprint.toString();
        }