]> git.basschouten.com Git - openhab-addons.git/blob
d2c2a160f7492a51fa6d9a72bacfa26c9622f52c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.avmfritz.internal.dto.templates;
14
15 import java.util.Collections;
16 import java.util.List;
17
18 import javax.xml.bind.annotation.XmlAccessType;
19 import javax.xml.bind.annotation.XmlAccessorType;
20 import javax.xml.bind.annotation.XmlAttribute;
21 import javax.xml.bind.annotation.XmlElement;
22 import javax.xml.bind.annotation.XmlRootElement;
23 import javax.xml.bind.annotation.XmlType;
24
25 /**
26  * This JAXB model class maps the XML response to an <b>gettemplatelistinfos</b> command on a FRITZ!Box device.
27  *
28  * @author Christoph Weitkamp - Initial contribution
29  */
30 @XmlAccessorType(XmlAccessType.FIELD)
31 @XmlType
32 @XmlRootElement(name = "templatelist")
33 public class TemplateListModel {
34
35     @XmlAttribute(name = "version")
36     private String version;
37
38     @XmlElement(name = "template")
39     private List<TemplateModel> templates;
40
41     public List<TemplateModel> getTemplates() {
42         if (templates == null) {
43             templates = Collections.emptyList();
44         }
45         return templates;
46     }
47
48     public String getVersion() {
49         return version;
50     }
51
52     @Override
53     public String toString() {
54         return new StringBuilder().append("[templates=").append(templates).append(",version=").append(version)
55                 .append("]").toString();
56     }
57 }