Package org.openhab.core.thing.type
Interface ChannelTypeBuilder<T extends ChannelTypeBuilder<T>>
- All Known Subinterfaces:
StateChannelTypeBuilder
,TriggerChannelTypeBuilder
@NonNullByDefault
public interface ChannelTypeBuilder<@NonNull T extends ChannelTypeBuilder<@NonNull T>>
Interface for
ChannelTypeBuilder
.- Author:
- Stefan Triller - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the ChannelType with the given valuesisAdvanced
(boolean advanced) Specify whether this is an advanced channel, default is falsestatic StateChannelTypeBuilder
state
(ChannelTypeUID channelTypeUID, String label, String itemType) Create an instance of a ChannelTypeBuilder forChannelType
s of type STATEstatic TriggerChannelTypeBuilder
trigger
(ChannelTypeUID channelTypeUID, String label) Create an instance of a ChannelTypeBuilder forChannelType
s of type TRIGGERwithCategory
(String category) Sets the Category for the ChannelTypewithConfigDescriptionURI
(URI configDescriptionURI) Sets the ConfigDescriptionURI for the ChannelTypewithDescription
(String description) Sets the Description for the ChannelTypeAdds a tag to the ChannelTypewithTags
(Collection<String> tags) Sets the StateDescription for the ChannelType
-
Method Details
-
isAdvanced
Specify whether this is an advanced channel, default is false- Parameters:
advanced
- true if this is an advancedChannelType
- Returns:
- this Builder
-
withDescription
Sets the Description for the ChannelType- Parameters:
description
- StateDescription for the ChannelType- Returns:
- this Builder
-
withCategory
Sets the Category for the ChannelType- Parameters:
category
- Category for the ChannelType- Returns:
- this Builder
-
withTag
Adds a tag to the ChannelType- Parameters:
tag
- Tag to be added to the ChannelType- Returns:
- this Builder
-
withTags
Sets the StateDescription for the ChannelType- Parameters:
tags
- Collection of tags to be added to the ChannelType- Returns:
- this Builder
-
withConfigDescriptionURI
Sets the ConfigDescriptionURI for the ChannelType- Parameters:
configDescriptionURI
- URI that references the ConfigDescription of the ChannelType- Returns:
- this Builder
-
build
ChannelType build()Build the ChannelType with the given values- Returns:
- the created ChannelType
-
state
Create an instance of a ChannelTypeBuilder forChannelType
s of type STATE- Parameters:
channelTypeUID
- UID of the ChannelTypelabel
- Label for the ChannelTypeitemType
- ItemType that can be linked to the ChannelType- Returns:
- ChannelTypeBuilder for
ChannelType
s of type STATE
-
trigger
Create an instance of a ChannelTypeBuilder forChannelType
s of type TRIGGER- Parameters:
channelTypeUID
- UID of the ChannelTypelabel
- Label for the ChannelType- Returns:
- ChannelTypeBuilder for
ChannelType
s of type TRIGGER
-