a85a6abd5c97fe4297499e07333b6dae9c054f90
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Album.java
1 /*
2  * Sone - Album.java - Copyright © 2011 David Roden
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 package net.pterodactylus.sone.data;
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23 /**
24  * Container for images that can also contain nested {@link Album}s.
25  *
26  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
27  */
28 public class Album {
29
30         /** Nested albums. */
31         private final List<Album> albums = new ArrayList<Album>();
32
33         /** The images in this album. */
34         private final List<Image> images = new ArrayList<Image>();
35
36         /** The name of this album. */
37         private String name;
38
39         //
40         // ACCESSORS
41         //
42
43         /**
44          * Returns the nested albums.
45          *
46          * @return The nested albums
47          */
48         public List<Album> getNestedAlbums() {
49                 return new ArrayList<Album>(albums);
50         }
51
52         /**
53          * Returns the images in this album.
54          *
55          * @return The images in this album
56          */
57         public List<Image> getImages() {
58                 return new ArrayList<Image>(images);
59         }
60
61         /**
62          * Returns the name of this album.
63          *
64          * @return The name of this album
65          */
66         public String getName() {
67                 return name;
68         }
69
70         /**
71          * Sets the name of this album.
72          *
73          * @param name
74          *            The name of this album
75          * @return This album
76          */
77         public Album setName(String name) {
78                 this.name = name;
79                 return this;
80         }
81
82 }