]> git.basschouten.com Git - openhab-addons.git/blob
4eb89453aff43a64b821507eda90c67deb2dd47f
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.openthermgateway.internal;
14
15 import javax.measure.Unit;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * The {@link DataItem} holds the internal OpenTherm message and meta data.
22  *
23  * @author Arjen Korevaar - Initial contribution
24  */
25 @NonNullByDefault
26 public class DataItem {
27     private int id;
28     private Msg msg;
29     private ByteType byteType;
30     private DataType dataType;
31     private int bitpos;
32     private String subject;
33     private @Nullable Unit<?> unit;
34     private @Nullable CodeType filteredCode;
35
36     public int getID() {
37         return id;
38     }
39
40     public Msg getMsg() {
41         return msg;
42     }
43
44     public ByteType getByteType() {
45         return this.byteType;
46     }
47
48     public DataType getDataType() {
49         return dataType;
50     }
51
52     public int getBitPos() {
53         return bitpos;
54     }
55
56     public String getSubject() {
57         return subject;
58     }
59
60     public @Nullable Unit<?> getUnit() {
61         return unit;
62     }
63
64     public @Nullable CodeType getFilteredCode() {
65         return filteredCode;
66     }
67
68     public DataItem(int id, Msg msg, ByteType byteType, DataType dataType, int bit, String subject) {
69         this(id, msg, byteType, dataType, bit, subject, null, null);
70     }
71
72     public DataItem(int id, Msg msg, ByteType byteType, DataType dataType, int bit, String subject, Unit<?> unit) {
73         this(id, msg, byteType, dataType, bit, subject, unit, null);
74     }
75
76     public DataItem(int id, Msg msg, ByteType byteType, DataType dataType, int bit, String subject,
77             CodeType filteredCode) {
78         this(id, msg, byteType, dataType, bit, subject, null, filteredCode);
79     }
80
81     public DataItem(int id, Msg msg, ByteType byteType, DataType dataType, int bit, String subject,
82             @Nullable Unit<?> unit, @Nullable CodeType filteredCode) {
83         this.id = id;
84         this.msg = msg;
85         this.byteType = byteType;
86         this.dataType = dataType;
87         this.bitpos = bit;
88         this.subject = subject;
89         this.unit = unit;
90         this.filteredCode = filteredCode;
91     }
92 }