]> git.basschouten.com Git - openhab-addons.git/blob
d0fbf348fc6d5809194a8b48c3fe28d23c870fc3
[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.nikohomecontrol.internal.protocol.nhc1;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Class {@link NhcMessageBase1} used as base class for output from gson for cmd or event feedback from Niko Home
20  * Control. This class only contains the common base fields required for the deserializer
21  * {@link NikoHomeControlMessageDeserializer1} to select the specific formats implemented in {@link NhcMessageMap1},
22  * {@link NhcMessageListMap1}, {@link NhcMessageCmd1}.
23  * <p>
24  *
25  * @author Mark Herwege - Initial Contribution
26  */
27 @NonNullByDefault
28 abstract class NhcMessageBase1 {
29
30     private @Nullable String cmd;
31     private @Nullable String event;
32
33     String getCmd() {
34         String cmd = this.cmd;
35         return ((cmd != null) ? cmd : "");
36     }
37
38     void setCmd(String cmd) {
39         this.cmd = cmd;
40     }
41
42     String getEvent() {
43         String event = this.event;
44         return ((event != null) ? event : "");
45     }
46
47     void setEvent(String event) {
48         this.event = event;
49     }
50 }