]> git.basschouten.com Git - openhab-addons.git/blob
193a193ee597ee778d2fe3d6712567239b7144cd
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.io.neeo.internal.models;
14
15 import java.util.Arrays;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * The model representing a Neeo Directory (list) Channel (serialize/deserialize json use only).
22  *
23  * @author Tim Roberts - Initial Contribution
24  */
25 @NonNullByDefault
26 public class NeeoDeviceChannelDirectory extends NeeoDeviceChannel {
27
28     private final NeeoDeviceChannelDirectoryListItem[] listItems;
29
30     /**
31      * Create a new channel based on the parms
32      *
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}
42      */
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);
47
48         this.listItems = listItems;
49     }
50
51     /**
52      * A non-null, possibly empty array of {@link NeeoDeviceChannelDirectoryListItem}
53      *
54      * @return a non-null, possibly empty array of {@link NeeoDeviceChannelDirectoryListItem}
55      */
56     public NeeoDeviceChannelDirectoryListItem[] getListItems() {
57         return listItems;
58     }
59
60     @Override
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) + "]";
65     }
66 }