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.io.neeo.internal.models;
15 import java.util.Arrays;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
21 * The model representing a Neeo Directory (list) Channel (serialize/deserialize json use only).
23 * @author Tim Roberts - Initial Contribution
26 public class NeeoDeviceChannelDirectory extends NeeoDeviceChannel {
28 private final NeeoDeviceChannelDirectoryListItem[] listItems;
31 * Create a new channel based on the parms
33 * @param kind the non-null kind of channel
34 * @param itemName the non-empty item name
35 * @param channelNbr the channel number (must be >= 0)
36 * @param type the non-null type
37 * @param subType the non-null subtype
38 * @param label the non-empty label
39 * @param value the possibly null, possibly empty value
40 * @param range the possibly null range
41 * @param listItems the non-null, possibly empty array of {@link NeeoDeviceChannelDirectoryListItem}
43 public NeeoDeviceChannelDirectory(NeeoDeviceChannelKind kind, String itemName, int channelNbr,
44 NeeoCapabilityType type, ItemSubType subType, String label, @Nullable String value,
45 @Nullable NeeoDeviceChannelRange range, NeeoDeviceChannelDirectoryListItem[] listItems) {
46 super(kind, itemName, channelNbr, type, subType, label, value, range);
48 this.listItems = listItems;
52 * A non-null, possibly empty array of {@link NeeoDeviceChannelDirectoryListItem}
54 * @return a non-null, possibly empty array of {@link NeeoDeviceChannelDirectoryListItem}
56 public NeeoDeviceChannelDirectoryListItem[] getListItems() {
61 public String toString() {
62 return "NeeoDeviceChannelDirectory [kind=" + getKind() + ", itemName=" + getItemName() + ", channelNbr="
63 + getChannelNbr() + ", type=" + getType() + ", subType=" + getSubType() + ", label=" + getLabel()
64 + ", value=" + getValue() + ", range=" + getRange() + ", listItems=" + Arrays.toString(listItems) + "]";