Package org.openhab.core.thing
Class Channel
java.lang.Object
org.openhab.core.thing.Channel
Channel is a part of a Thing that represents a functionality of it. Therefore Items can be
linked a to a channel. The channel only accepts a specific item type which is specified by
getAcceptedItemType() methods. Use the ChannelBuilder for building channels.- Author:
- Dennis Nobel - Initial contribution, Alex Tugarev - Extended about default tags, Benedikt Niehues - fix for Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=445137 considering default values, Chris Jackson - Added properties, label, description, Kai Kreuzer - Removed linked items from channel
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedChannel(ChannelUID uid, @Nullable ChannelTypeUID channelTypeUID, @Nullable String acceptedItemType, ChannelKind kind, @Nullable Configuration configuration, Set<String> defaultTags, @Nullable Map<String, String> properties, @Nullable String label, @Nullable String description, @Nullable AutoUpdatePolicy autoUpdatePolicy) Use theChannelBuilderfor building channels. -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable StringReturns the accepted item type.@Nullable AutoUpdatePolicy@Nullable ChannelTypeUIDReturns the channel type UIDReturns the channel configurationReturns default tags of this channel.@Nullable StringReturns the description (if set).getKind()Returns the channel kind.@Nullable StringgetLabel()Returns the label (if set).Returns an immutable copy of theChannelproperties.getUID()Returns the unique id of the channel.inthashCode()
-
Constructor Details
-
Channel
protected Channel(ChannelUID uid, @Nullable ChannelTypeUID channelTypeUID, @Nullable String acceptedItemType, ChannelKind kind, @Nullable Configuration configuration, Set<String> defaultTags, @Nullable Map<String, String> properties, @Nullable String label, @Nullable String description, @Nullable AutoUpdatePolicy autoUpdatePolicy) Use theChannelBuilderfor building channels.
-
-
Method Details
-
getAcceptedItemType
Returns the accepted item type.- Returns:
- accepted item type
-
getKind
Returns the channel kind.- Returns:
- channel kind
-
getUID
Returns the unique id of the channel.- Returns:
- unique id of the channel
-
getChannelTypeUID
Returns the channel type UID- Returns:
- channel type UID or null if no channel type is specified
-
getLabel
Returns the label (if set). If no label is set, getLabel will return null and the default label for theChannelis used.- Returns:
- the label for the channel. Can be null.
-
getDescription
Returns the description (if set). If no description is set, getDescription will return null and the default description for theChannelis used.- Returns:
- the description for the channel. Can be null.
-
getConfiguration
Returns the channel configuration- Returns:
- channel configuration (not null)
-
getProperties
Returns an immutable copy of theChannelproperties.- Returns:
- an immutable copy of the
Channelproperties (notnull)
-
getDefaultTags
Returns default tags of this channel.- Returns:
- default tags of this channel.
-
getAutoUpdatePolicy
-
equals
-
hashCode
public int hashCode()
-