Package org.openhab.core.thing
Class ChannelUID
java.lang.Object
org.openhab.core.common.AbstractUID
org.openhab.core.thing.UID
org.openhab.core.thing.ChannelUID
ChannelUID
represents a unique identifier for channels.- Author:
- Oliver Libutzki - Initial contribution, Jochen Hiller - Bugfix 455434: added default constructor, Dennis Nobel - Added channel group id, Kai Kreuzer - Changed creation of channels to not require a thing type, Christoph Weitkamp - Changed pattern for validating last segment to contain either a single `#` or none
-
Field Summary
Fields inherited from class org.openhab.core.common.AbstractUID
SEGMENT_PATTERN, SEPARATOR
-
Constructor Summary
ConstructorDescriptionChannelUID
(String channelUid) Parses aChannelUID
for a given string.ChannelUID
(ChannelGroupUID channelGroupUID, String id) ChannelUID
(ThingUID thingUID, String id) ChannelUID
(ThingUID thingUID, String groupId, String id) -
Method Summary
Modifier and TypeMethodDescription@Nullable String
Returns the group id.getId()
Returns the id.Returns the id without the group id.protected int
Specifies how many segments the UID has to have at least.Returns the thing UIDboolean
protected void
validateSegment
(String segment, int index, int length) Methods inherited from class org.openhab.core.thing.UID
equals, getAllSegments, getAsString, getBindingId, hashCode, toString
Methods inherited from class org.openhab.core.common.AbstractUID
getSegment
-
Field Details
-
CHANNEL_SEGMENT_PATTERN
- See Also:
-
CHANNEL_GROUP_SEPARATOR
- See Also:
-
-
Constructor Details
-
ChannelUID
Parses aChannelUID
for a given string. The UID must be in the format 'bindingId:segment:segment:...'.- Parameters:
channelUid
- uid in form a string
-
ChannelUID
- Parameters:
thingUID
- the unique identifier of the thing the channel belongs toid
- the channel's id
-
ChannelUID
- Parameters:
channelGroupUID
- the unique identifier of the channel group the channel belongs toid
- the channel's id
-
ChannelUID
- Parameters:
thingUID
- the unique identifier of the thing the channel belongs togroupId
- the channel's group idid
- the channel's id
-
-
Method Details
-
getId
Returns the id.- Returns:
- id
-
getIdWithoutGroup
Returns the id without the group id.- Returns:
- id id without group id
-
isInGroup
public boolean isInGroup() -
getGroupId
Returns the group id.- Returns:
- group id or null if channel is not in a group
-
getMinimalNumberOfSegments
protected int getMinimalNumberOfSegments()Description copied from class:AbstractUID
Specifies how many segments the UID has to have at least.- Specified by:
getMinimalNumberOfSegments
in classAbstractUID
- Returns:
- the number of segments
-
validateSegment
- Overrides:
validateSegment
in classAbstractUID
-
getThingUID
Returns the thing UID- Returns:
- the thing UID
-