]> git.basschouten.com Git - openhab-addons.git/blob
4eb8ca33111d77a7d9de219b571790ebc5e801e9
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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
35     public int getID() {
36         return id;
37     }
38
39     public Msg getMsg() {
40         return msg;
41     }
42
43     public ByteType getByteType() {
44         return this.byteType;
45     }
46
47     public DataType getDataType() {
48         return dataType;
49     }
50
51     public int getBitPos() {
52         return bitpos;
53     }
54
55     public String getSubject() {
56         return subject;
57     }
58
59     public @Nullable Unit<?> getUnit() {
60         return unit;
61     }
62
63     public DataItem(int id, Msg msg, ByteType byteType, DataType dataType, int bit, String subject) {
64         this.id = id;
65         this.msg = msg;
66         this.byteType = byteType;
67         this.dataType = dataType;
68         this.bitpos = bit;
69         this.subject = subject;
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);
74         this.unit = unit;
75     }
76 }