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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record
AbstractThingFileGenerator.ConfigParameter
is a container for any configuration parameter defined by a name and a value. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractThingFileGenerator
(ThingTypeRegistry thingTypeRegistry, ChannelTypeRegistry channelTypeRegistry, ConfigDescriptionRegistry configDescRegistry) -
Method Summary
Modifier and TypeMethodDescriptiongetChildThings
(Thing thing) Get the child things of a bridge thing, ordered by UID.protected List
<AbstractThingFileGenerator.ConfigParameter> getConfigurationParameters
(Channel channel, boolean hideDefaultParameters) Get the list of configuration parameters for a channel.protected List
<AbstractThingFileGenerator.ConfigParameter> getConfigurationParameters
(Thing thing, boolean hideDefaultParameters) Get the list of configuration parameters for a thing.getNonDefaultChannels
(Thing thing) Get non default channels.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openhab.core.thing.fileconverter.ThingFileGenerator
generateFileFormat, getFileFormatGenerator
-
Constructor Details
-
AbstractThingFileGenerator
public AbstractThingFileGenerator(ThingTypeRegistry thingTypeRegistry, ChannelTypeRegistry channelTypeRegistry, ConfigDescriptionRegistry configDescRegistry)
-
-
Method Details
-
getChildThings
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 thinghideDefaultParameters
- 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 channelhideDefaultParameters
- true to hide the configuration parameters having the default value- Returns:
- the sorted list of configuration parameters for the channel
-
getNonDefaultChannels
Get non default channels. It includes extensible channels and channels with a non default configuration.- Parameters:
thing
- the thing- Returns:
- the list of channels
-