Class AbstractThingFileGenerator

java.lang.Object
org.openhab.core.thing.fileconverter.AbstractThingFileGenerator
All Implemented Interfaces:
ThingFileGenerator

@NonNullByDefault public abstract class AbstractThingFileGenerator extends Object implements ThingFileGenerator
AbstractThingFileGenerator is the base class for any Thing file generator.
Author:
Laurent Garnier - Initial contribution
  • Constructor Details

  • Method Details

    • getChildThings

      protected List<Thing> getChildThings(Thing thing)
      Get the child things of a bridge thing, ordered by UID.
      Parameters:
      thing - the thing
      Returns:
      the sorted list of child things or an empty list if the thing is not a bridge thing
    • getConfigurationParameters

      protected List<AbstractThingFileGenerator.ConfigParameter> getConfigurationParameters(Thing thing, boolean hideDefaultParameters)
      Get the list of configuration parameters for a thing. If a configuration description is found for the thing type, the parameters are provided in the same order as in this configuration description, and any parameter having the default value is ignored. If not, the parameters are provided sorted by natural order of their names.
      Parameters:
      thing - the thing
      hideDefaultParameters - true to hide the configuration parameters having the default value
      Returns:
      the sorted list of configuration parameters for the thing
    • getConfigurationParameters

      protected List<AbstractThingFileGenerator.ConfigParameter> getConfigurationParameters(Channel channel, boolean hideDefaultParameters)
      Get the list of configuration parameters for a channel. If a configuration description is found for the channel type, the parameters are provided in the same order as in this configuration description, and any parameter having the default value is ignored. If not, the parameters are provided sorted by natural order of their names.
      Parameters:
      channel - the channel
      hideDefaultParameters - true to hide the configuration parameters having the default value
      Returns:
      the sorted list of configuration parameters for the channel
    • getNonDefaultChannels

      protected List<Channel> getNonDefaultChannels(Thing thing)
      Get non default channels. It includes extensible channels and channels with a non default configuration.
      Parameters:
      thing - the thing
      Returns:
      the list of channels