]> git.basschouten.com Git - openhab-addons.git/blob
6b1239bae8285062ce6ff4f5c7205d63a85231b5
[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.tr064.internal.config;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.tr064.internal.dto.config.ChannelTypeDescription;
18 import org.openhab.binding.tr064.internal.dto.scpd.root.SCPDServiceType;
19 import org.openhab.binding.tr064.internal.dto.scpd.service.SCPDActionType;
20
21 /**
22  * The {@link Tr064ChannelConfig} class holds a channel configuration
23  *
24  * @author Jan N. Klug - Initial contribution
25  */
26 @NonNullByDefault
27 public class Tr064ChannelConfig {
28     private ChannelTypeDescription channelTypeDescription;
29     private SCPDServiceType service;
30     private @Nullable SCPDActionType getAction;
31     private String dataType = "";
32     private @Nullable String parameter;
33
34     public Tr064ChannelConfig(ChannelTypeDescription channelTypeDescription, SCPDServiceType service) {
35         this.channelTypeDescription = channelTypeDescription;
36         this.service = service;
37     }
38
39     public Tr064ChannelConfig(Tr064ChannelConfig o) {
40         this.channelTypeDescription = o.channelTypeDescription;
41         this.service = o.service;
42         this.getAction = o.getAction;
43         this.dataType = o.dataType;
44         this.parameter = o.parameter;
45     }
46
47     public ChannelTypeDescription getChannelTypeDescription() {
48         return channelTypeDescription;
49     }
50
51     public SCPDServiceType getService() {
52         return service;
53     }
54
55     public String getDataType() {
56         return dataType;
57     }
58
59     public void setDataType(String dataType) {
60         this.dataType = dataType;
61     }
62
63     public @Nullable SCPDActionType getGetAction() {
64         return getAction;
65     }
66
67     public void setGetAction(SCPDActionType getAction) {
68         this.getAction = getAction;
69     }
70
71     public @Nullable String getParameter() {
72         return parameter;
73     }
74
75     public void setParameter(String parameter) {
76         this.parameter = parameter;
77     }
78
79     @Override
80     public String toString() {
81         final SCPDActionType getAction = this.getAction;
82         return "Tr064ChannelConfig{" + "channelType=" + channelTypeDescription.getName() + ", getAction="
83                 + ((getAction == null) ? "(null)" : getAction.getName()) + ", dataType='" + dataType + ", parameter='"
84                 + parameter + "'}";
85     }
86 }