]> git.basschouten.com Git - openhab-addons.git/blob
a12a9865e8e7ad76f0558f73fb916945c86f8c8c
[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.XmlElement;
21 import javax.xml.bind.annotation.XmlRootElement;
22
23 /**
24  * See {@ TemplateModel}.
25  *
26  * @author Christoph Weitkamp - Initial contribution
27  */
28 @XmlAccessorType(XmlAccessType.FIELD)
29 @XmlRootElement(name = "devices")
30 public class DeviceListModel {
31
32     @XmlElement(name = "device")
33     private List<DeviceModel> devices;
34
35     public List<DeviceModel> getDevices() {
36         if (devices == null) {
37             devices = Collections.emptyList();
38         }
39         return devices;
40     }
41
42     @Override
43     public String toString() {
44         return new StringBuilder().append("[devices=").append(devices).append("]").toString();
45     }
46 }