Make releases of a party availabable.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 30 Jul 2012 07:48:08 +0000 (09:48 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 30 Jul 2012 07:51:14 +0000 (09:51 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DefaultParty.java
src/main/java/net/pterodactylus/demoscenemusic/data/Party.java

index 993d69a..1b3ace4 100644 (file)
@@ -17,6 +17,7 @@
 
 package net.pterodactylus.demoscenemusic.data;
 
+import java.util.Collection;
 /**
  * Default implementation of a party data container.
  *
@@ -55,4 +56,22 @@ public class DefaultParty extends DefaultBase implements Party {
                return this;
        }
 
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       @SuppressWarnings("unchecked")
+       public Collection<Track> getReleases() {
+               return getValue("releases", Collection.class).get();
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       public Party setReleases(Collection<Track> tracks) {
+               getValue("releases", Collection.class).set(tracks);
+               return this;
+       }
+
 }
index 8ce4bcc..301e9c8 100644 (file)
@@ -17,6 +17,8 @@
 
 package net.pterodactylus.demoscenemusic.data;
 
+import java.util.Collection;
+
 /**
  * Data interface for parties.
  *
@@ -40,4 +42,20 @@ public interface Party extends Base {
         */
        public Party setName(String name);
 
+       /**
+        * Returns all tracks that were released at this party.
+        *
+        * @return All tracks that were released at this party
+        */
+       public Collection<Track> getReleases();
+
+       /**
+        * Sets all tracks that were released at this party.
+        *
+        * @param tracks
+        *            All tracks that were released at this party
+        * @return This party
+        */
+       public Party setReleases(Collection<Track> tracks);
+
 }