]> git.basschouten.com Git - openhab-addons.git/blob
7c0944a798f958f442366209b8c7d3170147bfba
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.upnpcontrol.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  *
20  * @author Mark Herwege - Initial contribution
21  */
22 @NonNullByDefault
23 class UpnpEntryRes {
24
25     private String protocolInfo;
26     private @Nullable Long size;
27     private String duration;
28     private String importUri;
29     private String res = "";
30
31     UpnpEntryRes(String protocolInfo, @Nullable Long size, @Nullable String duration, @Nullable String importUri) {
32         this.protocolInfo = protocolInfo;
33         this.size = size;
34         this.duration = (duration == null) ? "" : duration;
35         this.importUri = (importUri == null) ? "" : importUri;
36     }
37
38     /**
39      * @return the res
40      */
41     public String getRes() {
42         return res;
43     }
44
45     /**
46      * @param res the res to set
47      */
48     public void setRes(String res) {
49         this.res = res;
50     }
51
52     public String getProtocolInfo() {
53         return protocolInfo;
54     }
55
56     /**
57      * @return the size
58      */
59     public @Nullable Long getSize() {
60         return size;
61     }
62
63     /**
64      * @return the duration
65      */
66     public String getDuration() {
67         return duration;
68     }
69
70     /**
71      * @return the importUri
72      */
73     public String getImportUri() {
74         return importUri;
75     }
76
77     /**
78      * @return true if this resource defines a thumbnail as specified in the DLNA specs
79      */
80     public boolean isThumbnailRes() {
81         return getProtocolInfo().toLowerCase().contains("dlna.org_pn=jpeg_tn");
82     }
83 }