Add methods to manage artists of a group.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 14:29:42 +0000 (16:29 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 14:29:42 +0000 (16:29 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DefaultGroup.java
src/main/java/net/pterodactylus/demoscenemusic/data/Group.java

index 38ababe..4495830 100644 (file)
@@ -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<Artist> artists() {
+               return value("artists", Collection.class).get();
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       public Group artists(Collection<Artist> artists) {
+               value("artists", Collection.class).set(artists);
+               return this;
+       }
+
        private static class GroupCreator implements ObjectCreator<Group> {
 
                /**
index 8ab2f87..5f135f9 100644 (file)
@@ -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<Artist> artists();
+
+       public Group artists(Collection<Artist> artists);
+
 }