Class ChannelGroupDefinition

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

@NonNullByDefault public class ChannelGroupDefinition extends Object
The ChannelGroupDefinition class defines a ChannelGroupType of a ThingType.

A ChannelGroupType is part of a Thing that represents a set of channels (functionalities) of it.

Hint: This class is immutable.

Author:
Michael Grammling - Initial contribution, Dennis Nobel - Introduced ChannelTypeRegistry and channel type references
  • Constructor Details

    • ChannelGroupDefinition

      public ChannelGroupDefinition(String id, ChannelGroupTypeUID typeUID, @Nullable String label, @Nullable String description) throws IllegalArgumentException
      Creates a new instance of this class with the specified parameters.
      Parameters:
      id - the identifier of the channel group (must not be empty)
      typeUID - the type UID of the channel group
      label - the label for the channel group to override ChannelGroupType
      description - the description for the channel group to override ChannelGroupType
      Throws:
      IllegalArgumentException - if the ID is empty
    • ChannelGroupDefinition

      public ChannelGroupDefinition(String id, ChannelGroupTypeUID typeUID) throws IllegalArgumentException
      Creates a new instance of this class with the specified parameters.
      Parameters:
      id - the identifier of the channel group (must not be empty)
      typeUID - the type UID of the channel group
      Throws:
      IllegalArgumentException - if the ID is empty
  • Method Details

    • getId

      public String getId()
      Returns the identifier of the channel group.
      Returns:
      the identifier of the channel group (not empty)
    • getTypeUID

      public ChannelGroupTypeUID getTypeUID()
      Returns the type UID of the channel group.
      Returns:
      the type UID of the channel group
    • getLabel

      public @Nullable String getLabel()
      Returns the label (if set). If no label is set, getLabel will return null and the default label for the ChannelGroupType is used.
      Returns:
      the label for the channel group.
    • getDescription

      public @Nullable String getDescription()
      Returns the description (if set). If no description is set, getDescription will return null and the default description for the ChannelGroupType is used.
      Returns:
      the description for the channel group.
    • toString

      public String toString()
      Overrides:
      toString in class Object