Add javadoc.
[demoscenemusic.git] / src / main / java / net / pterodactylus / demoscenemusic / data / DefaultTrack.java
1 /*
2  * DemosceneMusic - Track.java - Copyright © 2012 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.demoscenemusic.data;
19
20 import java.util.Collection;
21 import java.util.List;
22
23 /**
24  * Default implementation of a track data container.
25  *
26  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
27  */
28 public class DefaultTrack extends DefaultBase implements Track {
29
30         /**
31          * Creates a new track data container.
32          *
33          * @param id
34          *            The ID of the track
35          */
36         public DefaultTrack(String id) {
37                 super(id);
38         }
39
40         //
41         // TRACK METHODS
42         //
43
44         /**
45          * {@inheritDoc}
46          */
47         @Override
48         public String getName() {
49                 return getValue("name", String.class).get();
50         }
51
52         /**
53          * {@inheritDoc}
54          */
55         @Override
56         public Track setName(String name) {
57                 getValue("name", String.class).set(name);
58                 return this;
59         }
60
61         /**
62          * {@inheritDoc}
63          */
64         @Override
65         @SuppressWarnings("unchecked")
66         public List<Artist> getArtists() {
67                 return getValue("artists", List.class).get();
68         }
69
70         /**
71          * {@inheritDoc}
72          */
73         @Override
74         public Track setArtists(List<Artist> artists) {
75                 getValue("artists", List.class).set(artists);
76                 return this;
77         }
78
79         /**
80          * {@inheritDoc}
81          */
82         @Override
83         @SuppressWarnings("unchecked")
84         public Collection<Style> getStyles() {
85                 return getValue("styles", Collection.class).get();
86         }
87
88         /**
89          * {@inheritDoc}
90          */
91         @Override
92         public Track setStyles(Collection<? extends Style> styles) {
93                 getValue("styles", Collection.class).set(styles);
94                 return this;
95         }
96
97 }