]> git.basschouten.com Git - openhab-addons.git/blob
3b315d399bc0549f2698075a26df1fcef0befc47
[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 org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * The model representing a Neeo text Channel (serialize/deserialize json use only).
20  *
21  * @author Tim Roberts - Initial Contribution
22  */
23 @NonNullByDefault
24 public class NeeoDeviceChannelText extends NeeoDeviceChannel {
25
26     /** Whether the text label is visible or not */
27     private final boolean labelVisible;
28
29     /**
30      * Create a new channel based on the parms
31      *
32      * @param kind the non-null kind of channel
33      * @param itemName the non-empty item name
34      * @param channelNbr the channel number (must be >= 0)
35      * @param type the non-null type
36      * @param subType the non-null subtype
37      * @param label the non-empty label
38      * @param value the possibly null, possibly empty value
39      * @param range the possibly null range
40      * @param labelVisible true if the text has a visible label
41      */
42     public NeeoDeviceChannelText(NeeoDeviceChannelKind kind, String itemName, int channelNbr, NeeoCapabilityType type,
43             ItemSubType subType, String label, @Nullable String value, @Nullable NeeoDeviceChannelRange range,
44             boolean labelVisible) {
45         super(kind, itemName, channelNbr, type, subType, label, value, range);
46
47         this.labelVisible = labelVisible;
48     }
49
50     /**
51      * Whether the text label is visible or not
52      *
53      * @return true if visible, false otherwise
54      */
55     public boolean isLabelVisible() {
56         return labelVisible;
57     }
58
59     @Override
60     public String toString() {
61         return "NeeoDeviceChannelText [kind=" + getKind() + ", itemName=" + getItemName() + ", channelNbr="
62                 + getChannelNbr() + ", type=" + getType() + ", subType=" + getSubType() + ", label=" + getLabel()
63                 + ", value=" + getValue() + ", range=" + getRange() + ", labelVisible=" + labelVisible + "]";
64     }
65 }