View Javadoc
1   /*
2    * Copyright (C) 2013 4th Line GmbH, Switzerland
3    *
4    * The contents of this file are subject to the terms of either the GNU
5    * Lesser General Public License Version 2 or later ("LGPL") or the
6    * Common Development and Distribution License Version 1 or later
7    * ("CDDL") (collectively, the "License"). You may not use this file
8    * except in compliance with the License. See LICENSE.txt for more
9    * information.
10   *
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14   */
15  
16  package org.fourthline.cling.support.model.item;
17  
18  import org.fourthline.cling.support.model.Res;
19  import org.fourthline.cling.support.model.container.Container;
20  
21  import java.net.URI;
22  
23  import static org.fourthline.cling.support.model.DIDLObject.Property.UPNP;
24  
25  /**
26   * @author Christian Bauer
27   */
28  public class VideoBroadcast extends VideoItem {
29  
30      public static final Class CLASS = new Class("object.item.videoItem.videoBroadcast");
31  
32      public VideoBroadcast() {
33          setClazz(CLASS);
34      }
35  
36      public VideoBroadcast(Item other) {
37          super(other);
38      }
39  
40      public VideoBroadcast(String id, Container parent, String title, String creator, Res... resource) {
41          this(id, parent.getId(), title, creator, resource);
42      }
43  
44      public VideoBroadcast(String id, String parentID, String title, String creator, Res... resource) {
45          super(id, parentID, title, creator, resource);
46          setClazz(CLASS);
47      }
48  
49      public URI getIcon() {
50          return getFirstPropertyValue(UPNP.ICON.class);
51      }
52  
53      public VideoBroadcast setIcon(URI icon) {
54          replaceFirstProperty(new UPNP.ICON(icon));
55          return this;
56      }
57  
58      public String getRegion() {
59          return getFirstPropertyValue(UPNP.REGION.class);
60      }
61  
62      public VideoBroadcast setRegion(String region) {
63          replaceFirstProperty(new UPNP.REGION(region));
64          return this;
65      }
66  
67      public Integer getChannelNr() {
68          return getFirstPropertyValue(UPNP.CHANNEL_NR.class);
69      }
70  
71      public VideoBroadcast setChannelNr(Integer channelNr) {
72          replaceFirstProperty(new UPNP.CHANNEL_NR(channelNr));
73          return this;
74      }
75  }