Class ChannelType

All Implemented Interfaces:
Identifiable<UID>

@NonNullByDefault public class ChannelType extends AbstractDescriptionType
The ChannelType describes a concrete type of Channel.

This description is used as template definition for the creation of the according concrete Channel object. Use the ChannelTypeBuilder for building channel types.

Hint: This class is immutable.

Author:
Michael Grammling - Initial contribution, Henning Treu - add command options, Mark Herwege - added unit hint
  • Constructor Details

    • ChannelType

      protected ChannelType(ChannelTypeUID uid, boolean advanced, @Nullable String itemType, @Nullable String unitHint, ChannelKind kind, String label, @Nullable String description, @Nullable String category, @Nullable Set<String> tags, @Nullable StateDescription state, @Nullable CommandDescription commandDescription, @Nullable EventDescription event, @Nullable URI configDescriptionURI, @Nullable AutoUpdatePolicy autoUpdatePolicy) throws IllegalArgumentException
      Creates a new instance of this class with the specified parameters.
      Parameters:
      uid - the unique identifier which identifies this Channel type within the overall system (must neither be null, nor empty)
      advanced - true if this channel type contains advanced features, otherwise false
      itemType - the item type of this Channel type, e.g. ColorItem
      kind - the channel kind.
      label - the human-readable label for the according type (must neither be null nor empty)
      description - the human-readable description for the according type (could be null or empty)
      category - the category of this Channel type, e.g. TEMPERATURE (could be null or empty)
      tags - all tags of this ChannelType, e.g. Alarm (could be null or empty)
      state - a StateDescription of an items state which gives information how to interpret it.
      commandDescription - a CommandDescription which should be rendered as push-buttons. The command values will be sent to the channel from this ChannelType.
      configDescriptionURI - the link to the concrete ConfigDescription (could be null)
      autoUpdatePolicy - the AutoUpdatePolicy to use.
      Throws:
      IllegalArgumentException - if the UID or the item type is null or empty, or the meta information is null
  • Method Details

    • getUID

      public ChannelTypeUID getUID()
      Description copied from class: AbstractDescriptionType
      Returns the unique identifier which identifies the according type within the overall system.
      Specified by:
      getUID in interface Identifiable<UID>
      Overrides:
      getUID in class AbstractDescriptionType
      Returns:
      the unique identifier which identifies the according type within the overall system (neither null, nor empty)
    • getItemType

      public @Nullable String getItemType()
      Returns the item type of this ChannelType, e.g. ColorItem.
      Returns:
      the item type of this Channel type, e.g. ColorItem. Can be null if the channel is a trigger channel.
    • getKind

      public ChannelKind getKind()
      Returns the kind of this ChannelType, e.g. STATE.
      Returns:
      the kind of this Channel type, e.g. STATE.
    • getTags

      public Set<String> getTags()
      Returns all tags of this ChannelType, e.g. Alarm.
      Returns:
      all tags of this Channel type, e.g. Alarm
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getState

      public @Nullable StateDescription getState()
      Returns the StateDescription of an items state which gives information how to interpret it.
      Returns:
      the StateDescription
    • getUnitHint

      public @Nullable String getUnitHint()
      Returns the unitHint of a channel which gives information on what unit to suggest when creating an item linked to the channel.
      Returns:
      the unitHint
    • getEvent

      public @Nullable EventDescription getEvent()
      Returns information about the supported events.
      Returns:
      the event information. Can be null if the channel is a state channel.
    • isAdvanced

      public boolean isAdvanced()
      Returns true if this channel type contains advanced functionalities which should be typically not shown in the basic view of user interfaces, otherwise false.
      Returns:
      true if this channel type contains advanced functionalities, otherwise false
    • getCategory

      public @Nullable String getCategory()
      Returns the category of this ChannelType, e.g. TEMPERATURE.
      Returns:
      the category of this Channel type, e.g. TEMPERATURE
    • getAutoUpdatePolicy

      public @Nullable AutoUpdatePolicy getAutoUpdatePolicy()
      Returns the AutoUpdatePolicy of for channels of this type.
      Returns:
      the AutoUpdatePolicy. Can be null if the channel is a trigger channel.
    • getCommandDescription

      public @Nullable CommandDescription getCommandDescription()
      Returns the CommandDescription which should be rendered as push-buttons.
      Returns:
      the CommandDescription