Class ChannelType

  • All Implemented Interfaces:
    Identifiable<UID>

    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.

    Hint: This class is immutable.

    Author:
    Michael Grammling - Initial contribution, Henning Treu - add command options
    • Constructor Detail

      • ChannelType

        public ChannelType​(ChannelTypeUID uid,
                           boolean advanced,
                           String itemType,
                           String label,
                           String description,
                           String category,
                           Set<String> tags,
                           CommandDescription commandDescription,
                           URI configDescriptionURI,
                           AutoUpdatePolicy autoUpdatePolicy)
        Creates a new instance of a "write-only" ChannelType with command options. The purpose of this ChannelType is to send command to a device without updating the state of the corresponding channel. E.g. activate a special device mode which is not represented as a definitive state.
        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 (must neither be null nor empty)
        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)
        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
      • ChannelType

        public ChannelType​(ChannelTypeUID uid,
                           boolean advanced,
                           String itemType,
                           ChannelKind kind,
                           String label,
                           String description,
                           String category,
                           Set<String> tags,
                           StateDescription state,
                           EventDescription event,
                           URI configDescriptionURI,
                           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 - the restrictions of an item state which gives information how to interpret it (could be null)
        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 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 (not null, could be empty)
      • getConfigDescriptionURI

        public URI getConfigDescriptionURI()
        Returns the link to a concrete ConfigDescription.
        Returns:
        the link to a concrete ConfigDescription (could be null)
      • getState

        public StateDescription getState()
        Returns the restrictions of an item state which gives information how to interpret it.
        Returns:
        the restriction of an item state which gives information how to interpret it (could be null)
      • getEvent

        public EventDescription getEvent()
        Returns informations about the supported events.
        Returns:
        the event information (could be null)
      • 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 String getCategory()
        Returns the category of this ChannelType, e.g. TEMPERATURE.
        Returns:
        the category of this Channel type, e.g. TEMPERATURE (could be null or empty)