From ca43577fb67eaa9199a4f42e62d4c802814ec9fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 1 Jan 2011 13:55:33 +0100 Subject: [PATCH] Add methods to add and remove albums from an album. --- .../java/net/pterodactylus/sone/data/Album.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- 2.7.4