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 static org.fourthline.cling.support.model.DIDLObject.Property.UPNP;
22  
23  /**
24   * @author Christian Bauer
25   */
26  public class Photo extends ImageItem {
27  
28      public static final Class CLASS = new Class("object.item.imageItem.photo");
29  
30      public Photo() {
31          setClazz(CLASS);
32      }
33  
34      public Photo(Item other) {
35          super(other);
36      }
37  
38      public Photo(String id, Container parent, String title, String creator, String album, Res... resource) {
39          this(id, parent.getId(), title, creator, album, resource);
40      }
41  
42      public Photo(String id, String parentID, String title, String creator, String album, Res... resource) {
43          super(id, parentID, title, creator, resource);
44          setClazz(CLASS);
45          if (album != null)
46              setAlbum(album);
47      }
48  
49      public String getAlbum() {
50          return getFirstPropertyValue(UPNP.ALBUM.class);
51      }
52  
53      public Photo setAlbum(String album) {
54          replaceFirstProperty(new UPNP.ALBUM(album));
55          return this;
56      }
57  
58  
59  }