From cf06b3a6434f85821bca923b80364806b10f73f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 19 Apr 2012 16:29:42 +0200 Subject: [PATCH] Add methods to manage artists of a group. --- .../demoscenemusic/data/DefaultGroup.java | 19 +++++++++++++++++++ .../net/pterodactylus/demoscenemusic/data/Group.java | 6 ++++++ 2 files changed, 25 insertions(+) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultGroup.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultGroup.java index 38ababe..4495830 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultGroup.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DefaultGroup.java @@ -19,6 +19,7 @@ package net.pterodactylus.demoscenemusic.data; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.Collection; import net.pterodactylus.util.database.ObjectCreator; @@ -65,6 +66,24 @@ public class DefaultGroup extends DefaultBase implements Group { return this; } + /** + * {@inheritDoc} + */ + @Override + @SuppressWarnings("unchecked") + public Collection artists() { + return value("artists", Collection.class).get(); + } + + /** + * {@inheritDoc} + */ + @Override + public Group artists(Collection artists) { + value("artists", Collection.class).set(artists); + return this; + } + private static class GroupCreator implements ObjectCreator { /** diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/Group.java b/src/main/java/net/pterodactylus/demoscenemusic/data/Group.java index 8ab2f87..5f135f9 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/Group.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/Group.java @@ -17,6 +17,8 @@ package net.pterodactylus.demoscenemusic.data; +import java.util.Collection; + /** * TODO * @@ -32,4 +34,8 @@ public interface Group extends Base { public Group url(String url); + public Collection artists(); + + public Group artists(Collection artists); + } -- 2.7.4