Class BridgeBuilder
java.lang.Object
org.openhab.core.thing.binding.builder.ThingBuilder
org.openhab.core.thing.binding.builder.BridgeBuilder
This class allows the easy construction of a
Bridge instance using the builder pattern.- Author:
- Dennis Nobel - Initial contribution, Kai Kreuzer - Refactoring to make BridgeBuilder a subclass of ThingBuilder, Markus Rathgeb - Override methods to return BridgeBuidler instead of ThingBuidler, Andrew Fiddian-Green - Added semanticEquipmentTag
-
Field Summary
Fields inherited from class org.openhab.core.thing.binding.builder.ThingBuilder
thingTypeUID, thingUID -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the thingstatic BridgeBuilderCreate a new bridgeBridgeBuilderfor a copy of the given bridgestatic BridgeBuildercreate(ThingTypeUID thingTypeUID, String bridgeId) static BridgeBuildercreate(ThingTypeUID thingTypeUID, ThingUID thingUID) withBridge(@Nullable ThingUID bridgeUID) Set the bridge for this thingwithChannel(Channel channel) Adds the given channel to the thingwithChannels(List<Channel> channels) Replaces all channels of this thing with the given channelswithChannels(Channel... channels) Replaces all channels of this thing with the given channelswithConfiguration(Configuration thingConfiguration) Set (or replace) the configuration of the thingSets thelabelfor the thingwithLocation(@Nullable String location) Set the location for this thingwithoutChannel(ChannelUID channelUID) Removes the channel with the given UID from the thingwithoutChannels(List<Channel> channels) Removes the given channels from the thingwithoutChannels(Channel... channels) Removes the given channels from the thingwithProperties(Map<String, String> properties) Set/replace the properties for this thingwithSemanticEquipmentTag(@Nullable String semanticEquipmentTag) Set the semantic (equipment) tag for this thingwithSemanticEquipmentTag(SemanticTag semanticEquipmentTag) Set the semantic (equipment) tag for this thingMethods inherited from class org.openhab.core.thing.binding.builder.ThingBuilder
create, populate, withProperty
-
Method Details
-
create
-
create
-
create
Create a new bridgeBridgeBuilderfor a copy of the given bridge- Parameters:
bridge- theBridgeto create this builder from- Returns:
- the created
BridgeBuilder
-
build
Description copied from class:ThingBuilderBuild the thing- Overrides:
buildin classThingBuilder- Returns:
- the
Thing
-
withLabel
Description copied from class:ThingBuilderSets thelabelfor the thing- Overrides:
withLabelin classThingBuilder- Parameters:
label- a string containing the label- Returns:
- the
ThingBuilderitself
-
withChannel
Description copied from class:ThingBuilderAdds the given channel to the thing- Overrides:
withChannelin classThingBuilder- Parameters:
channel- theChannel- Returns:
- the
ThingBuilderitself
-
withChannels
Description copied from class:ThingBuilderReplaces all channels of this thing with the given channels- Overrides:
withChannelsin classThingBuilder- Parameters:
channels- one or moreChannels- Returns:
- the
ThingBuilderitself
-
withChannels
Description copied from class:ThingBuilderReplaces all channels of this thing with the given channels- Overrides:
withChannelsin classThingBuilder- Parameters:
channels- aListofChannels- Returns:
- the
ThingBuilderitself
-
withoutChannel
Description copied from class:ThingBuilderRemoves the channel with the given UID from the thing- Overrides:
withoutChannelin classThingBuilder- Parameters:
channelUID- theChannelUIDof the channel- Returns:
- the
ThingBuilderitself
-
withoutChannels
Description copied from class:ThingBuilderRemoves the given channels from the thing- Overrides:
withoutChannelsin classThingBuilder- Parameters:
channels- one or moreChannels- Returns:
- the
ThingBuilderitself
-
withoutChannels
Description copied from class:ThingBuilderRemoves the given channels from the thing- Overrides:
withoutChannelsin classThingBuilder- Parameters:
channels- aListofChannels- Returns:
- the
ThingBuilderitself
-
withConfiguration
Description copied from class:ThingBuilderSet (or replace) the configuration of the thing- Overrides:
withConfigurationin classThingBuilder- Parameters:
thingConfiguration- aConfigurationfor this thing- Returns:
- the
ThingBuilderitself
-
withBridge
Description copied from class:ThingBuilderSet the bridge for this thing- Overrides:
withBridgein classThingBuilder- Parameters:
bridgeUID- theThingUIDof the bridge for the thing- Returns:
- the
ThingBuilderitself
-
withProperties
Description copied from class:ThingBuilderSet/replace the properties for this thing- Overrides:
withPropertiesin classThingBuilder- Parameters:
properties- aMap<String,containing the propertiesString> - Returns:
- the
ThingBuilderitself
-
withLocation
Description copied from class:ThingBuilderSet the location for this thing- Overrides:
withLocationin classThingBuilder- Parameters:
location- a string wih the location of the thing- Returns:
- the
ThingBuilderitself
-
withSemanticEquipmentTag
Description copied from class:ThingBuilderSet the semantic (equipment) tag for this thing- Overrides:
withSemanticEquipmentTagin classThingBuilder- Parameters:
semanticEquipmentTag- a string with semantic (equipment) tag for this thing- Returns:
- the
ThingBuilderitself
-
withSemanticEquipmentTag
Description copied from class:ThingBuilderSet the semantic (equipment) tag for this thing- Overrides:
withSemanticEquipmentTagin classThingBuilder- Parameters:
semanticEquipmentTag- semantic (equipment) tag for this thing- Returns:
- the
ThingBuilderitself
-