From: David ‘Bombe’ Roden Date: Sat, 1 Jan 2011 13:01:35 +0000 (+0100) Subject: Add methods to add and remove images to or from an album. X-Git-Tag: beta-freefall-0.6.2-1~145 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=55ee8d58d39bf1e6f0edc3baebb1b1119f92a6c1 Add methods to add and remove images to or from an album. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index 50b7254..d53ba6e 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -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