Class Channel

java.lang.Object
org.openhab.core.thing.Channel

@NonNullByDefault public class Channel extends Object
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 Details

  • Method Details

    • getAcceptedItemType

      public @Nullable String getAcceptedItemType()
      Returns the accepted item type.
      Returns:
      accepted item type
    • getKind

      public ChannelKind getKind()
      Returns the channel kind.
      Returns:
      channel kind
    • getUID

      public ChannelUID getUID()
      Returns the unique id of the channel.
      Returns:
      unique id of the channel
    • getChannelTypeUID

      public @Nullable ChannelTypeUID getChannelTypeUID()
      Returns the channel type UID
      Returns:
      channel type UID or null if no channel type is specified
    • getLabel

      public @Nullable String getLabel()
      Returns the label (if set). If no label is set, getLabel will return null and the default label for the Channel is used.
      Returns:
      the label for the channel. Can be null.
    • getDescription

      public @Nullable String getDescription()
      Returns the description (if set). If no description is set, getDescription will return null and the default description for the Channel is used.
      Returns:
      the description for the channel. Can be null.
    • getConfiguration

      public Configuration getConfiguration()
      Returns the channel configuration
      Returns:
      channel configuration (not null)
    • getProperties

      public Map<String,String> getProperties()
      Returns an immutable copy of the Channel properties.
      Returns:
      an immutable copy of the Channel properties (not null)
    • getDefaultTags

      public Set<String> getDefaultTags()
      Returns default tags of this channel.
      Returns:
      default tags of this channel.
    • getAutoUpdatePolicy

      public @Nullable AutoUpdatePolicy getAutoUpdatePolicy()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object