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