Package org.openhab.core.thing.binding
Class ThingFactory
java.lang.Object
org.openhab.core.thing.binding.ThingFactory
ThingFactory helps to create thing based on a given ThingType .- Author:
- Dennis Nobel - Initial contribution, added support for channel groups, Benedikt Niehues - fix for Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=445137 considering default values, Thomas Höfer - added thing and thing type properties, Chris Jackson - Added properties, label, description, Andrew Fiddian-Green - Added semanticEquipmentTag
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic @Nullable ThingcreateThing(ThingUID thingUID, Configuration configuration, @Nullable Map<String, String> properties, @Nullable ThingUID bridgeUID, ThingTypeUID thingTypeUID, List<ThingHandlerFactory> thingHandlerFactories) static ThingcreateThing(ThingType thingType, ThingUID thingUID, Configuration configuration) Creates a thing based on given thing type.static ThingcreateThing(ThingType thingType, ThingUID thingUID, Configuration configuration, @Nullable ThingUID bridgeUID) Creates a thing based on a given thing type.static ThingcreateThing(ThingType thingType, ThingUID thingUID, Configuration configuration, @Nullable ThingUID bridgeUID, @Nullable ConfigDescriptionRegistry configDescriptionRegistry) Creates a thing based on a given thing type.static ThingUIDgenerateRandomThingUID(ThingTypeUID thingTypeUID) Generates a random Thing UID for the given thingType
- 
Constructor Details- 
ThingFactorypublic ThingFactory()
 
- 
- 
Method Details- 
generateRandomThingUIDGenerates a random Thing UID for the given thingType- Parameters:
- thingTypeUID- thing type (must not be null)
- Returns:
- random Thing UID
 
- 
createThingpublic static Thing createThing(ThingType thingType, ThingUID thingUID, Configuration configuration, @Nullable ThingUID bridgeUID) Creates a thing based on a given thing type.- Parameters:
- thingType- thing type (must not be null)
- thingUID- thindUID (must not be null)
- configuration- (must not be null)
- bridgeUID- (can be null)
- Returns:
- thing the thing
 
- 
createThingpublic static Thing createThing(ThingType thingType, ThingUID thingUID, Configuration configuration, @Nullable ThingUID bridgeUID, @Nullable ConfigDescriptionRegistry configDescriptionRegistry) Creates a thing based on a given thing type. It also creates the default-configuration given in the configDescriptions if the configDescriptionRegistry is not null- Parameters:
- thingType- (must not be null)
- thingUID- (must not be null)
- configuration- (must not be null)
- bridgeUID- (can be null)
- configDescriptionRegistry- (can be null)
- Returns:
- thing the thing
 
- 
createThingpublic static @Nullable Thing createThing(ThingUID thingUID, Configuration configuration, @Nullable Map<String, String> properties, @Nullable ThingUID bridgeUID, ThingTypeUID thingTypeUID, List<ThingHandlerFactory> thingHandlerFactories) 
- 
createThingpublic static Thing createThing(ThingType thingType, ThingUID thingUID, Configuration configuration) Creates a thing based on given thing type.- Parameters:
- thingType- thing type (must not be null)
- thingUID- thingUID (must not be null)
- configuration- (must not be null)
- Returns:
- thing the thing
 
 
-