Add methods to add and remove albums from an album.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 1 Jan 2011 12:55:33 +0000 (13:55 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 1 Jan 2011 12:55:33 +0000 (13:55 +0100)
src/main/java/net/pterodactylus/sone/data/Album.java

index 792f518..50b7254 100644 (file)
@@ -104,6 +104,28 @@ public class Album {
        }
 
        /**
+        * Adds an album to this album.
+        *
+        * @param album
+        *            The album to add
+        */
+       public void addAlbum(Album album) {
+               Validation.begin().isNotNull("Album", album).check().isEqual("Album Owner", album.sone, sone).check();
+               albums.add(album);
+       }
+
+       /**
+        * Removes an album from this album.
+        *
+        * @param album
+        *            The album to remove
+        */
+       public void removeAlbum(Album album) {
+               Validation.begin().isNotNull("Album", album).check().isEqual("Album Owner", album.sone, sone).check();
+               albums.remove(album);
+       }
+
+       /**
         * Returns the images in this album.
         *
         * @return The images in this album