2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.openthermgateway.internal;
15 import javax.measure.Unit;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
21 * The {@link DataItem} holds the internal OpenTherm message and meta data.
23 * @author Arjen Korevaar - Initial contribution
26 public class DataItem {
29 private ByteType byteType;
30 private DataType dataType;
32 private String subject;
33 private @Nullable Unit<?> unit;
34 private @Nullable CodeType filteredCode;
44 public ByteType getByteType() {
48 public DataType getDataType() {
52 public int getBitPos() {
56 public String getSubject() {
60 public @Nullable Unit<?> getUnit() {
64 public @Nullable CodeType getFilteredCode() {
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);
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);
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);
81 public DataItem(int id, Msg msg, ByteType byteType, DataType dataType, int bit, String subject,
82 @Nullable Unit<?> unit, @Nullable CodeType filteredCode) {
85 this.byteType = byteType;
86 this.dataType = dataType;
88 this.subject = subject;
90 this.filteredCode = filteredCode;