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

index 50b7254..d53ba6e 100644 (file)
@@ -135,6 +135,28 @@ public class Album {
        }
 
        /**
+        * Adds the given image to this album.
+        *
+        * @param image
+        *            The image to add
+        */
+       public void addImage(Image image) {
+               Validation.begin().isNotNull("Image", image).check().isEqual("Image Owner", image.getSone(), sone).check();
+               images.add(image);
+       }
+
+       /**
+        * Removes the given image from this album.
+        *
+        * @param image
+        *            The image to remove
+        */
+       public void removeImage(Image image) {
+               Validation.begin().isNotNull("Image", image).check().isEqual("Image Owner", image.getSone(), sone).check();
+               images.remove(image);
+       }
+
+       /**
         * Returns the name of this album.
         *
         * @return The name of this album