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
FieldsFields inherited from class org.openhab.core.common.AbstractUID
SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionChannelUID(String channelUid) Parses aChannelUIDfor 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 StringReturns the group id.getId()Returns the id.Returns the id without the group id.protected intSpecifies how many segments the UID has to have at least.Returns the thing UIDbooleanprotected voidvalidateSegment(String segment, int index, int length) Methods inherited from class org.openhab.core.thing.UID
equals, getAllSegments, getAsString, getBindingId, hashCode, toStringMethods inherited from class org.openhab.core.common.AbstractUID
getSegment, isValid
-
Field Details
-
CHANNEL_SEGMENT_PATTERN
-
CHANNEL_GROUP_SEPARATOR
- See Also:
-
-
Constructor Details
-
ChannelUID
Parses aChannelUIDfor 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:AbstractUIDSpecifies how many segments the UID has to have at least.- Specified by:
getMinimalNumberOfSegmentsin classAbstractUID- Returns:
- the number of segments
-
validateSegment
- Overrides:
validateSegmentin classAbstractUID
-
getThingUID
Returns the thing UID- Returns:
- the thing UID
-