2 * Copyright (c) 2010-2023 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.phc.internal.handler;
15 import org.openhab.core.types.Command;
18 * Object to save a whole message.
20 * @author Jonas Hohaus - Initial contribution
23 private final String moduleType;
24 private final byte moduleAddress;
25 private final byte channel;
26 private final Command command;
30 public QueueObject(String moduleType, byte moduleAddress, byte channel, Command command) {
31 this.moduleType = moduleType;
32 this.moduleAddress = moduleAddress;
33 this.channel = channel;
34 this.command = command;
37 public QueueObject(String moduleType, int moduleAddress, String channel, Command command) {
38 this.moduleType = moduleType;
39 this.moduleAddress = (byte) moduleAddress;
40 this.channel = Byte.parseByte(channel);
41 this.command = command;
44 public QueueObject(String moduleType, int moduleAddress, String channel, Command command, short time) {
45 this(moduleType, moduleAddress, channel, command);
49 public String getModuleType() {
53 public byte getModuleAddress() {
57 public byte getChannel() {
61 public Command getCommand() {
65 public short getTime() {
70 public String toString() {
71 StringBuilder sb = new StringBuilder();
72 sb.append("moduleType: ");
73 sb.append(moduleType);
74 sb.append(", moduleAddress: ");
75 sb.append(moduleAddress);
76 sb.append(", channel: ");