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 Item
s 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
ModifierConstructorDescriptionprotected
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 theChannelBuilder
for building channels. -
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable String
Returns the accepted item type.@Nullable AutoUpdatePolicy
@Nullable ChannelTypeUID
Returns the channel type UIDReturns the channel configurationReturns default tags of this channel.@Nullable String
Returns the description (if set).getKind()
Returns the channel kind.@Nullable String
getLabel()
Returns the label (if set).Returns an immutable copy of theChannel
properties.getUID()
Returns the unique id of the channel.int
hashCode()
-
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 theChannelBuilder
for 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 theChannel
is 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 theChannel
is 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 theChannel
properties.- Returns:
- an immutable copy of the
Channel
properties (notnull
)
-
getDefaultTags
Returns default tags of this channel.- Returns:
- default tags of this channel.
-
getAutoUpdatePolicy
-
equals
-
hashCode
public int hashCode()
-