Package org.openhab.core.thing.type
Class ThingTypeBuilder
java.lang.Object
org.openhab.core.thing.type.ThingTypeBuilder
A
ThingType builder.- Author:
- Henning Treu - Initial contribution, Andrew Fiddian-Green - Added semanticEquipmentTag
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a newThingTypeaccording to the given values from this builder.Builds and returns a newBridgeTypeaccording to the given values from this builder.static ThingTypeBuilderstatic ThingTypeBuilderinstance(ThingTypeUID thingTypeUID, String label) static ThingTypeBuilderCreate this builder with all properties from the givenThingType.isListed(boolean listed) withCategory(String category) withChannelDefinitions(List<ChannelDefinition> channelDefinitions) withChannelGroupDefinitions(List<ChannelGroupDefinition> channelGroupDefinitions) withConfigDescriptionURI(URI configDescriptionURI) withDescription(String description) withExtensibleChannelTypeIds(List<String> extensibleChannelTypeIds) withProperties(Map<String, String> properties) withRepresentationProperty(String representationProperty) withSemanticEquipmentTag(String semanticEquipmentTag) withSemanticEquipmentTag(SemanticTag semanticEquipmentTag) withSupportedBridgeTypeUIDs(List<String> supportedBridgeTypeUIDs)
-
Method Details
-
instance
Create and return aThingTypeBuilderwith the givenbindingId,thingTypeIdandlabel. Also,listeddefaults totrue.- Parameters:
bindingId- the binding Id the resultingThingTypewill have. Must not be null or empty.thingTypeId- the thingTypeId the resultingThingTypewill have (builds aThingTypeUIDwithbindingId:thingTypeId. Must not be null or empty.label- the label of the resultingThingType. Must not be null or empty.- Returns:
- the new
ThingTypeBuilder.
-
instance
Create and return aThingTypeBuilderwith the givenThingTypeUIDandlabel. Also,listeddefaults totrue.- Parameters:
thingTypeUID- theThingTypeUIDthe resultingThingTypewill have. Must not be null.label- the label of the resultingThingType. Must not be null or empty.- Returns:
- the new
ThingTypeBuilder.
-
instance
Create this builder with all properties from the givenThingType.- Parameters:
thingType- take all properties from thisThingType.- Returns:
- a new
ThingTypeBuilderconfigured with all properties from the givenThingType;
-
build
Builds and returns a newThingTypeaccording to the given values from this builder.- Returns:
- a new
ThingTypeaccording to the given values from this builder. - Throws:
IllegalStateException- if one ofbindingId,thingTypeIdorlabelare not given.
-
buildBridge
Builds and returns a newBridgeTypeaccording to the given values from this builder.- Returns:
- a new
BridgeTypeaccording to the given values from this builder. - Throws:
IllegalStateException- if one ofbindingId,thingTypeIdorlabelare not given.
-
withLabel
-
withDescription
-
withCategory
-
isListed
-
withRepresentationProperty
-
withChannelDefinitions
-
withChannelGroupDefinitions
public ThingTypeBuilder withChannelGroupDefinitions(List<ChannelGroupDefinition> channelGroupDefinitions) -
withProperties
-
withConfigDescriptionURI
-
withExtensibleChannelTypeIds
-
withSupportedBridgeTypeUIDs
-
withSemanticEquipmentTag
-
withSemanticEquipmentTag
-