]> git.basschouten.com Git - openhab-addons.git/blob
778482bb68a4a922033c7cc38bfb7ce4ee6551aa
[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.qbus.internal.protocol;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Class {@link QbusMessageBase} used as base class for output from gson for cmd or event feedback from the Qbus server.
20  * This class only contains the common base fields required for the deserializer
21  * {@link QbusMessageDeserializer} to select the specific formats implemented in {@link QbusMessageMap},
22  * {@link QbusMessageListMap}, {@link QbusMessageCmd}.
23  * <p>
24  *
25  * @author Koen Schockaert - Initial Contribution
26  */
27
28 @NonNullByDefault
29 abstract class QbusMessageBase {
30
31     private @Nullable String ctd;
32     protected @Nullable String cmd;
33     protected @Nullable String type;
34     protected @Nullable Integer id;
35     protected @Nullable Integer state;
36     protected @Nullable Integer mode;
37     protected @Nullable Double setpoint;
38     protected @Nullable Double measured;
39     protected @Nullable Integer slatState;
40
41     @Nullable
42     String getSn() {
43         return this.ctd;
44     }
45
46     void setSn(String ctd) {
47         this.ctd = ctd;
48     }
49
50     @Nullable
51     String getCmd() {
52         return this.cmd;
53     }
54
55     void setCmd(String cmd) {
56         this.cmd = cmd;
57     }
58
59     @Nullable
60     public Integer getId() {
61         return id;
62     }
63
64     public void setType(String type) {
65         this.type = type;
66     }
67
68     @Nullable
69     public String getType() {
70         return type;
71     }
72
73     public void setId(Integer id) {
74         this.id = id;
75     }
76
77     @Nullable
78     public Integer getState() {
79         return state;
80     }
81
82     public void setState(int state) {
83         this.state = state;
84     }
85
86     @Nullable
87     public Integer getMode() {
88         return mode;
89     }
90
91     public void setMode(int mode) {
92         this.mode = mode;
93     }
94
95     @Nullable
96     public Double getSetPoint() {
97         return setpoint;
98     }
99
100     public void setSetPoint(Double setpoint) {
101         this.setpoint = setpoint;
102     }
103
104     @Nullable
105     public Double getMeasured() {
106         return measured;
107     }
108
109     public void setMeasured(Double measured) {
110         this.measured = measured;
111     }
112
113     @Nullable
114     public Integer getSlatState() {
115         return slatState;
116     }
117
118     public void setSlatState(int slatState) {
119         this.slatState = slatState;
120     }
121 }