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 javax.xml.bind.annotation.XmlAccessType;
16 import javax.xml.bind.annotation.XmlAccessorType;
17 import javax.xml.bind.annotation.XmlAttribute;
18 import javax.xml.bind.annotation.XmlElement;
19 import javax.xml.bind.annotation.XmlType;
21 import org.openhab.core.types.CommandOption;
24 * See {@link TemplateListModel}.
26 * @author Christoph Weitkamp - Initial contribution
28 @XmlAccessorType(XmlAccessType.FIELD)
29 @XmlType(name = "template")
30 public class TemplateModel {
32 @XmlAttribute(name = "identifier")
33 private String identifier;
35 @XmlAttribute(name = "id")
36 private String templateId;
38 @XmlAttribute(name = "functionbitmask")
39 private int functionbitmask;
41 @XmlAttribute(name = "applymask")
42 private int applymask;
44 @XmlElement(name = "name")
47 @XmlElement(name = "devices")
48 private DeviceListModel deviceList;
50 @XmlElement(name = "applymask")
51 private ApplyMaskListModel applyMaskList;
53 public String getIdentifier() {
54 return identifier != null ? identifier.replace(" ", "") : null;
57 public String getTemplateId() {
61 public String getName() {
65 public DeviceListModel getDeviceList() {
69 public ApplyMaskListModel getApplyMaskList() {
73 public CommandOption toCommandOption() {
74 return new CommandOption(getIdentifier(), getName());
78 public String toString() {
79 return new StringBuilder().append("[identifier=").append(identifier).append(",id=").append(templateId)
80 .append(",functionbitmask=").append(functionbitmask).append(",applymask=").append(applymask)
81 .append(",name=").append(name).append(",devices=").append(deviceList).append(",applymasks=")
82 .append(applyMaskList).append("]").toString();