2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.avmfritz.internal.dto.templates;
15 import java.util.Collections;
16 import java.util.List;
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;
26 * This JAXB model class maps the XML response to an <b>gettemplatelistinfos</b> command on a FRITZ!Box device.
28 * @author Christoph Weitkamp - Initial contribution
30 @XmlAccessorType(XmlAccessType.FIELD)
32 @XmlRootElement(name = "templatelist")
33 public class TemplateListModel {
35 @XmlAttribute(name = "version")
36 private String version;
38 @XmlElement(name = "template")
39 private List<TemplateModel> templates;
41 public List<TemplateModel> getTemplates() {
42 if (templates == null) {
43 templates = Collections.emptyList();
48 public String getVersion() {
53 public String toString() {
54 return new StringBuilder().append("[templates=").append(templates).append(",version=").append(version)
55 .append("]").toString();