Class ChannelDefinitionBuilder

java.lang.Object
org.openhab.core.thing.type.ChannelDefinitionBuilder

@NonNullByDefault public class ChannelDefinitionBuilder extends Object
Builder for a channel definition.
Author:
Markus Rathgeb - Initial contribution
  • Constructor Details

    • ChannelDefinitionBuilder

      public ChannelDefinitionBuilder(ChannelDefinition channelDefinition)
      Creates a new channel definition builder.
      Parameters:
      channelDefinition - the channel definition the builder should be initialized by
    • ChannelDefinitionBuilder

      public ChannelDefinitionBuilder(String id, ChannelTypeUID channelTypeUID)
      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

      public ChannelDefinitionBuilder withProperties(@Nullable Map<String,String> properties)
      Sets the properties.
      Parameters:
      properties - the properties
      Returns:
      the builder
    • withLabel

      public ChannelDefinitionBuilder withLabel(@Nullable String label)
      Sets the label.
      Parameters:
      label - the label
      Returns:
      the builder
    • withDescription

      public ChannelDefinitionBuilder withDescription(@Nullable String description)
      Sets the description.
      Parameters:
      description - the description
      Returns:
      the builder
    • withAutoUpdatePolicy

      public ChannelDefinitionBuilder withAutoUpdatePolicy(@Nullable AutoUpdatePolicy autoUpdatePolicy)
      Sets the auto update policy.
      Parameters:
      autoUpdatePolicy - the auto update policy
      Returns:
      the builder
    • build

      public ChannelDefinition build()
      Build a channel definition.
      Returns:
      channel definition