Package org.openhab.core.thing.type
Class ChannelDefinitionBuilder
java.lang.Object
org.openhab.core.thing.type.ChannelDefinitionBuilder
Builder for a channel definition.
- Author:
- Markus Rathgeb - Initial contribution
-
Constructor Summary
ConstructorDescriptionChannelDefinitionBuilder
(String id, ChannelTypeUID channelTypeUID) Creates a new channel definition builder.ChannelDefinitionBuilder
(ChannelDefinition channelDefinition) Creates a new channel definition builder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build a channel definition.withAutoUpdatePolicy
(@Nullable AutoUpdatePolicy autoUpdatePolicy) Sets the auto update policy.withDescription
(@Nullable String description) Sets the description.Sets the label.withProperties
(@Nullable Map<String, String> properties) Sets the properties.
-
Constructor Details
-
ChannelDefinitionBuilder
Creates a new channel definition builder.- Parameters:
channelDefinition
- the channel definition the builder should be initialized by
-
ChannelDefinitionBuilder
Creates a new channel definition builder.- Parameters:
id
- the identifier of the channel (must neither be null nor empty)channelTypeUID
- the type UID of the channel (must not be null)
-
-
Method Details
-
withProperties
Sets the properties.- Parameters:
properties
- the properties- Returns:
- the builder
-
withLabel
Sets the label.- Parameters:
label
- the label- Returns:
- the builder
-
withDescription
Sets the description.- Parameters:
description
- the description- Returns:
- the builder
-
withAutoUpdatePolicy
Sets the auto update policy.- Parameters:
autoUpdatePolicy
- the auto update policy- Returns:
- the builder
-
build
Build a channel definition.- Returns:
- channel definition
-