From: David ‘Bombe’ Roden Date: Sat, 1 Jan 2011 02:11:38 +0000 (+0100) Subject: Add album container. X-Git-Tag: beta-freefall-0.6.2-1~153 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=750189cec7fe3b815fa9b98625d66c61715eb443 Add album container. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java new file mode 100644 index 0000000..a85a6ab --- /dev/null +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -0,0 +1,82 @@ +/* + * Sone - Album.java - Copyright © 2011 David Roden + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.pterodactylus.sone.data; + +import java.util.ArrayList; +import java.util.List; + +/** + * Container for images that can also contain nested {@link Album}s. + * + * @author David ‘Bombe’ Roden + */ +public class Album { + + /** Nested albums. */ + private final List albums = new ArrayList(); + + /** The images in this album. */ + private final List images = new ArrayList(); + + /** The name of this album. */ + private String name; + + // + // ACCESSORS + // + + /** + * Returns the nested albums. + * + * @return The nested albums + */ + public List getNestedAlbums() { + return new ArrayList(albums); + } + + /** + * Returns the images in this album. + * + * @return The images in this album + */ + public List getImages() { + return new ArrayList(images); + } + + /** + * Returns the name of this album. + * + * @return The name of this album + */ + public String getName() { + return name; + } + + /** + * Sets the name of this album. + * + * @param name + * The name of this album + * @return This album + */ + public Album setName(String name) { + this.name = name; + return this; + } + +}