Class ChannelType

  • All Implemented Interfaces:
    Identifiable<UID>

    @NonNullByDefault
    public class ChannelType
    extends AbstractDescriptionType
    The ChannelType describes a concrete type of a 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
    • Constructor Detail

      • ChannelType

        protected ChannelType​(ChannelTypeUID uid,
                              boolean advanced,
                              @Nullable String itemType,
                              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 send 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 Detail

      • 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
      • getConfigDescriptionURI

        public @Nullable URI getConfigDescriptionURI()
        Returns the link to a concrete ConfigDescription.
        Returns:
        the link to a concrete ConfigDescription
      • getEvent

        public @Nullable EventDescription getEvent()
        Returns informations 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