Package org.openhab.core.thing.type
Class ChannelType
java.lang.Object
org.openhab.core.thing.type.AbstractDescriptionType
org.openhab.core.thing.type.ChannelType
- All Implemented Interfaces:
Identifiable<UID>
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 Summary
ModifierConstructorDescriptionprotected
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) Creates a new instance of this class with the specified parameters. -
Method Summary
Modifier and TypeMethodDescription@Nullable AutoUpdatePolicy
Returns theAutoUpdatePolicy
of for channels of this type.@Nullable String
Returns the category of thisChannelType
, e.g.@Nullable CommandDescription
Returns theCommandDescription
which should be rendered as push-buttons.@Nullable EventDescription
getEvent()
Returns information about the supported events.@Nullable String
Returns the item type of thisChannelType
, e.g.getKind()
Returns the kind of thisChannelType
, e.g.@Nullable StateDescription
getState()
Returns theStateDescription
of an items state which gives information how to interpret it.getTags()
Returns all tags of thisChannelType
, e.g.getUID()
Returns the unique identifier which identifies the according type within the overall system.@Nullable String
Returns theunitHint
of a channel which gives information on what unit to suggest when creating an item linked to the channel.boolean
Returnstrue
if this channel type contains advanced functionalities which should be typically not shown in the basic view of user interfaces, otherwisefalse
.toString()
Methods inherited from class org.openhab.core.thing.type.AbstractDescriptionType
getConfigDescriptionURI, getDescription, getLabel
-
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 falseitemType
- 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 thisChannelType
, e.g.Alarm
(could be null or empty)state
- aStateDescription
of an items state which gives information how to interpret it.commandDescription
- aCommandDescription
which should be rendered as push-buttons. The command values will be sent to the channel from thisChannelType
.configDescriptionURI
- the link to the concrete ConfigDescription (could be null)autoUpdatePolicy
- theAutoUpdatePolicy
to use.- Throws:
IllegalArgumentException
- if the UID or the item type is null or empty, or the meta information is null
-
-
Method Details
-
getUID
Description copied from class:AbstractDescriptionType
Returns the unique identifier which identifies the according type within the overall system.- Specified by:
getUID
in interfaceIdentifiable<UID>
- Overrides:
getUID
in classAbstractDescriptionType
- Returns:
- the unique identifier which identifies the according type within the overall system (neither null, nor empty)
-
getItemType
Returns the item type of thisChannelType
, 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
Returns the kind of thisChannelType
, e.g.STATE
.- Returns:
- the kind of this Channel type, e.g.
STATE
.
-
getTags
Returns all tags of thisChannelType
, e.g.Alarm
.- Returns:
- all tags of this Channel type, e.g.
Alarm
-
toString
-
getState
Returns theStateDescription
of an items state which gives information how to interpret it.- Returns:
- the
StateDescription
-
getUnitHint
Returns theunitHint
of a channel which gives information on what unit to suggest when creating an item linked to the channel.- Returns:
- the
unitHint
-
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()Returnstrue
if this channel type contains advanced functionalities which should be typically not shown in the basic view of user interfaces, otherwisefalse
.- Returns:
- true if this channel type contains advanced functionalities, otherwise false
-
getCategory
Returns the category of thisChannelType
, e.g.TEMPERATURE
.- Returns:
- the category of this Channel type, e.g.
TEMPERATURE
-
getAutoUpdatePolicy
Returns theAutoUpdatePolicy
of for channels of this type.- Returns:
- the
AutoUpdatePolicy
. Can be null if the channel is a trigger channel.
-
getCommandDescription
Returns theCommandDescription
which should be rendered as push-buttons.- Returns:
- the
CommandDescription
-