Add method to get all tracks by an artist to artist interface.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 14:00:13 +0000 (16:00 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 14:00:13 +0000 (16:00 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/Artist.java
src/main/java/net/pterodactylus/demoscenemusic/data/DefaultArtist.java

index f1874b2..36d2e2c 100644 (file)
@@ -17,6 +17,7 @@
 
 package net.pterodactylus.demoscenemusic.data;
 
+import java.util.Collection;
 import java.util.Set;
 
 /**
@@ -34,4 +35,8 @@ public interface Artist extends Base {
 
        public Artist groups(Set<Group> groups);
 
+       public Collection<Track> tracks();
+
+       public Artist tracks(Collection<Track> tracks);
+
 }
index 6fa8d43..4b7b5ef 100644 (file)
@@ -17,6 +17,7 @@
 
 package net.pterodactylus.demoscenemusic.data;
 
+import java.util.Collection;
 import java.util.Set;
 
 /**
@@ -55,4 +56,14 @@ public class DefaultArtist extends DefaultBase implements Artist {
                return this;
        }
 
+       public Collection<Track> tracks() {
+               return value("tracks", Collection.class).get();
+       }
+
+       @Override
+       public Artist tracks(Collection<Track> tracks) {
+               value("tracks", Collection.class).set(tracks);
+               return this;
+       }
+
 }