From f3d8fcb4cd0be44270bfab8c58c4a07565ce6a87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 30 Jul 2012 09:48:08 +0200 Subject: [PATCH] Make releases of a party availabable. --- .../demoscenemusic/data/DefaultParty.java | 19 +++++++++++++++++++ .../net/pterodactylus/demoscenemusic/data/Party.java | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultParty.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultParty.java index 993d69a..1b3ace4 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultParty.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultParty.java @@ -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 getReleases() { + return getValue("releases", Collection.class).get(); + } + + /** + * {@inheritDoc} + */ + @Override + public Party setReleases(Collection tracks) { + getValue("releases", Collection.class).set(tracks); + return this; + } + } diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/Party.java b/src/main/java/net/pterodactylus/demoscenemusic/data/Party.java index 8ce4bcc..301e9c8 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/Party.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/Party.java @@ -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 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 tracks); + } -- 2.7.4