2 * Copyright (c) 2010-2020 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.lutron.internal.protocol;
16 * Command to a Lutron integration access point.
18 * @author Allan Tong - Initial contribution
21 public class LutronCommand {
22 private final LutronOperation operation;
23 private final LutronCommandType type;
24 private final int integrationId;
25 private final Object[] parameters;
27 public LutronCommand(LutronOperation operation, LutronCommandType type, int integrationId, Object... parameters) {
28 this.operation = operation;
30 this.integrationId = integrationId;
31 this.parameters = parameters;
34 public LutronCommandType getType() {
38 public int getIntegrationId() {
39 return this.integrationId;
42 public Object[] getParameters() {
43 return this.parameters;
47 public String toString() {
48 StringBuilder builder = new StringBuilder().append(this.operation).append(this.type);
50 if (integrationId >= 0) {
51 builder.append(',').append(this.integrationId);
54 if (parameters != null) {
55 for (Object parameter : parameters) {
56 builder.append(',').append(parameter);
60 return builder.toString();