]> git.basschouten.com Git - openhab-addons.git/blob
eec9d4808d0c448a0bb2f76dac4a6f352b1ad314
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.modbus.internal.config;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Configuration for data thing
20  *
21  * @author Sami Salonen - Initial contribution
22  *
23  */
24 @NonNullByDefault
25 public class ModbusDataConfiguration {
26
27     private @Nullable String readStart;
28     private @Nullable String readTransform;
29     private @Nullable String readValueType;
30     private @Nullable String writeStart;
31     private @Nullable String writeType;
32     private @Nullable String writeTransform;
33     private @Nullable String writeValueType;
34     private boolean writeMultipleEvenWithSingleRegisterOrCoil;
35     private int writeMaxTries = 3; // backwards compatibility and tests
36     private long updateUnchangedValuesEveryMillis = 1000L;
37
38     public @Nullable String getReadStart() {
39         return readStart;
40     }
41
42     public void setReadStart(String readStart) {
43         this.readStart = readStart;
44     }
45
46     public @Nullable String getReadTransform() {
47         return readTransform;
48     }
49
50     public void setReadTransform(String readTransform) {
51         this.readTransform = readTransform;
52     }
53
54     public @Nullable String getReadValueType() {
55         return readValueType;
56     }
57
58     public void setReadValueType(String readValueType) {
59         this.readValueType = readValueType;
60     }
61
62     public @Nullable String getWriteStart() {
63         return writeStart;
64     }
65
66     public void setWriteStart(String writeStart) {
67         this.writeStart = writeStart;
68     }
69
70     public @Nullable String getWriteType() {
71         return writeType;
72     }
73
74     public void setWriteType(String writeType) {
75         this.writeType = writeType;
76     }
77
78     public @Nullable String getWriteTransform() {
79         return writeTransform;
80     }
81
82     public void setWriteTransform(String writeTransform) {
83         this.writeTransform = writeTransform;
84     }
85
86     public @Nullable String getWriteValueType() {
87         return writeValueType;
88     }
89
90     public void setWriteValueType(String writeValueType) {
91         this.writeValueType = writeValueType;
92     }
93
94     public boolean isWriteMultipleEvenWithSingleRegisterOrCoil() {
95         return writeMultipleEvenWithSingleRegisterOrCoil;
96     }
97
98     public void setWriteMultipleEvenWithSingleRegisterOrCoil(boolean writeMultipleEvenWithSingleRegisterOrCoil) {
99         this.writeMultipleEvenWithSingleRegisterOrCoil = writeMultipleEvenWithSingleRegisterOrCoil;
100     }
101
102     public int getWriteMaxTries() {
103         return writeMaxTries;
104     }
105
106     public void setWriteMaxTries(int writeMaxTries) {
107         this.writeMaxTries = writeMaxTries;
108     }
109
110     public long getUpdateUnchangedValuesEveryMillis() {
111         return updateUnchangedValuesEveryMillis;
112     }
113
114     public void setUpdateUnchangedValuesEveryMillis(long updateUnchangedValuesEveryMillis) {
115         this.updateUnchangedValuesEveryMillis = updateUnchangedValuesEveryMillis;
116     }
117 }