From: David ‘Bombe’ Roden Date: Thu, 19 Apr 2012 14:29:42 +0000 (+0200) Subject: Add methods to manage artists of a group. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=cf06b3a6434f85821bca923b80364806b10f73f1;p=demoscenemusic.git Add methods to manage artists of a group. --- 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); + }