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.enocean.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.core.thing.type.ChannelTypeUID;
21 * @author Daniel Weber - Initial contribution
22 * This class holds information for creating a channel of an EnOcean thing like acceptedItemType and
26 public class EnOceanChannelDescription {
27 public final ChannelTypeUID channelTypeUID;
28 public final String acceptedItemType;
29 public final String label;
30 public final boolean isStateChannel;
31 public final boolean autoCreate;
34 * Ctor for an EnOceanChannelDescription
36 * @param channelTypeUID ChannelTypeUID of channel
37 * @param acceptedItemType AcceptedItemType of channel like Switch, Dimmer or null if we accept everything
39 public EnOceanChannelDescription(ChannelTypeUID channelTypeUID, String itemType) {
40 this(channelTypeUID, itemType, "", true, true);
44 * Ctor for an EnOceanChannelDescription with detailed information
46 * @param channelTypeUID ChannelTypeUID of channel
47 * @param acceptedItemType ItemType of channel like Switch, Dimmer
48 * @param label of created channel
49 * @param isStateChannel otherwise created channel is a trigger channel
50 * @param autoCreate create channel during thing initialization, otherwise channel is created
53 public EnOceanChannelDescription(ChannelTypeUID channelTypeUID, @Nullable String itemType, @Nullable String label,
54 boolean isStateChannel, boolean autoCreate) {
55 this.channelTypeUID = channelTypeUID;
56 this.acceptedItemType = itemType != null ? itemType : "";
57 this.label = label != null ? label : "";
59 this.isStateChannel = isStateChannel;
60 this.autoCreate = autoCreate;