1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.fourthline.cling.support.model.container;
17
18 import java.net.URI;
19 import java.util.List;
20
21 import static org.fourthline.cling.support.model.DIDLObject.Property.UPNP;
22
23
24
25
26 public class MusicArtist extends PersonContainer {
27
28 public static final Class CLASS = new Class("object.container.person.musicArtist");
29
30 public MusicArtist() {
31 setClazz(CLASS);
32 }
33
34 public MusicArtist(Container other) {
35 super(other);
36 }
37
38 public MusicArtist(String id, Container parent, String title, String creator, Integer childCount) {
39 this(id, parent.getId(), title, creator, childCount);
40 }
41
42 public MusicArtist(String id, String parentID, String title, String creator, Integer childCount) {
43 super(id, parentID, title, creator, childCount);
44 setClazz(CLASS);
45 }
46
47 public String getFirstGenre() {
48 return getFirstPropertyValue(UPNP.GENRE.class);
49 }
50
51 public String[] getGenres() {
52 List<String> list = getPropertyValues(UPNP.GENRE.class);
53 return list.toArray(new String[list.size()]);
54 }
55
56 public MusicArtist setGenres(String[] genres) {
57 removeProperties(UPNP.GENRE.class);
58 for (String genre : genres) {
59 addProperty(new UPNP.GENRE(genre));
60 }
61 return this;
62 }
63
64 public URI getArtistDiscographyURI() {
65 return getFirstPropertyValue(UPNP.ARTIST_DISCO_URI.class);
66 }
67
68 public MusicArtist setArtistDiscographyURI(URI uri) {
69 replaceFirstProperty(new UPNP.ARTIST_DISCO_URI(uri));
70 return this;
71 }
72
73 }