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
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns a newThingType
according to the given values from this builder.Builds and returns a newBridgeType
according to the given values from this builder.static ThingTypeBuilder
static ThingTypeBuilder
instance
(ThingTypeUID thingTypeUID, String label) static ThingTypeBuilder
Create 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) withSupportedBridgeTypeUIDs
(List<String> supportedBridgeTypeUIDs)
-
Method Details
-
instance
Create and return aThingTypeBuilder
with the givenbindingId
,thingTypeId
andlabel
. Also,listed
defaults totrue
.- Parameters:
bindingId
- the binding Id the resultingThingType
will have. Must not be null or empty.thingTypeId
- the thingTypeId the resultingThingType
will have (builds aThingTypeUID
withbindingId: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 aThingTypeBuilder
with the givenThingTypeUID
andlabel
. Also,listed
defaults totrue
.- Parameters:
thingTypeUID
- theThingTypeUID
the resultingThingType
will 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
ThingTypeBuilder
configured with all properties from the givenThingType
;
-
build
Builds and returns a newThingType
according to the given values from this builder.- Returns:
- a new
ThingType
according to the given values from this builder. - Throws:
IllegalStateException
- if one ofbindingId
,thingTypeId
orlabel
are not given.
-
buildBridge
Builds and returns a newBridgeType
according to the given values from this builder.- Returns:
- a new
BridgeType
according to the given values from this builder. - Throws:
IllegalStateException
- if one ofbindingId
,thingTypeId
orlabel
are not given.
-
withLabel
-
withDescription
-
withCategory
-
isListed
-
withRepresentationProperty
-
withChannelDefinitions
-
withChannelGroupDefinitions
public ThingTypeBuilder withChannelGroupDefinitions(List<ChannelGroupDefinition> channelGroupDefinitions) -
withProperties
-
withConfigDescriptionURI
-
withExtensibleChannelTypeIds
-
withSupportedBridgeTypeUIDs
-