Class ThingTypeRegistry

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

@NonNullByDefault public class ThingTypeRegistry extends Object
The ThingTypeRegistry tracks all ThingTypes provided by registered ThingTypeProviders.
Author:
Oliver Libutzki - Initial contribution, Dennis Nobel - Added locale support
  • Constructor Details

  • Method Details

    • getThingTypes

      public List<ThingType> getThingTypes(@Nullable Locale locale)
      Returns all thing types.
      Parameters:
      locale - locale (can be null)
      Returns:
      all thing types
    • getThingTypes

      public List<ThingType> getThingTypes()
      Returns all thing types.
      Returns:
      all thing types
    • getThingTypes

      public List<ThingType> getThingTypes(String bindingId, @Nullable Locale locale)
      Returns thing types for a given binding id.
      Parameters:
      bindingId - binding id
      locale - locale (can be null)
      Returns:
      thing types for given binding id
    • getThingTypes

      public List<ThingType> getThingTypes(String bindingId)
      Returns thing types for a given binding id.
      Parameters:
      bindingId - binding id
      Returns:
      thing types for given binding id
    • getThingType

      public @Nullable ThingType getThingType(ThingTypeUID thingTypeUID, @Nullable Locale locale)
      Returns a thing type for a given thing type UID.
      Parameters:
      thingTypeUID - thing type UID
      locale - locale (can be null)
      Returns:
      thing type for given UID or null if no thing type with this UID was found
    • getThingType

      public @Nullable ThingType getThingType(ThingTypeUID thingTypeUID)
      Returns a thing type for a given thing type UID.
      Parameters:
      thingTypeUID - thing type UID
      Returns:
      thing type for given UID or null if no thing type with this UID was found
    • getChannelType

      public @Nullable ChannelType getChannelType(Channel channel)
      Returns the channel type for a given channel.
      Parameters:
      channel - channel
      Returns:
      channel type or null if no channel type was found
    • getChannelType

      public @Nullable ChannelType getChannelType(Channel channel, @Nullable Locale locale)
      Returns the channel type for a given channel and locale.
      Parameters:
      channel - channel
      locale - locale (can be null)
      Returns:
      channel type or null if no channel type was found
    • addThingTypeProvider

      protected void addThingTypeProvider(ThingTypeProvider thingTypeProvider)
    • removeThingTypeProvider

      protected void removeThingTypeProvider(ThingTypeProvider thingTypeProvider)