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
-
Field Summary
Fields inherited from class org.openhab.core.thing.binding.builder.ThingBuilder
thingTypeUID, thingUID
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the thingstatic BridgeBuilder
Create a new bridgeBridgeBuilder
for a copy of the given bridgestatic BridgeBuilder
create
(ThingTypeUID thingTypeUID, String bridgeId) static BridgeBuilder
create
(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 thelabel
for 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 thingMethods inherited from class org.openhab.core.thing.binding.builder.ThingBuilder
create, populate, withProperty
-
Method Details
-
create
-
create
-
create
Create a new bridgeBridgeBuilder
for a copy of the given bridge- Parameters:
bridge
- theBridge
to create this builder from- Returns:
- the created
BridgeBuilder
-
build
Description copied from class:ThingBuilder
Build the thing- Overrides:
build
in classThingBuilder
- Returns:
- the
Thing
-
withLabel
Description copied from class:ThingBuilder
Sets thelabel
for the thing- Overrides:
withLabel
in classThingBuilder
- Parameters:
label
- a string containing the label- Returns:
- the
ThingBuilder
itself
-
withChannel
Description copied from class:ThingBuilder
Adds the given channel to the thing- Overrides:
withChannel
in classThingBuilder
- Parameters:
channel
- theChannel
- Returns:
- the
ThingBuilder
itself
-
withChannels
Description copied from class:ThingBuilder
Replaces all channels of this thing with the given channels- Overrides:
withChannels
in classThingBuilder
- Parameters:
channels
- one or moreChannel
s- Returns:
- the
ThingBuilder
itself
-
withChannels
Description copied from class:ThingBuilder
Replaces all channels of this thing with the given channels- Overrides:
withChannels
in classThingBuilder
- Parameters:
channels
- aList
ofChannel
s- Returns:
- the
ThingBuilder
itself
-
withoutChannel
Description copied from class:ThingBuilder
Removes the channel with the given UID from the thing- Overrides:
withoutChannel
in classThingBuilder
- Parameters:
channelUID
- theChannelUID
of the channel- Returns:
- the
ThingBuilder
itself
-
withoutChannels
Description copied from class:ThingBuilder
Removes the given channels from the thing- Overrides:
withoutChannels
in classThingBuilder
- Parameters:
channels
- one or moreChannel
s- Returns:
- the
ThingBuilder
itself
-
withoutChannels
Description copied from class:ThingBuilder
Removes the given channels from the thing- Overrides:
withoutChannels
in classThingBuilder
- Parameters:
channels
- aList
ofChannel
s- Returns:
- the
ThingBuilder
itself
-
withConfiguration
Description copied from class:ThingBuilder
Set (or replace) the configuration of the thing- Overrides:
withConfiguration
in classThingBuilder
- Parameters:
thingConfiguration
- aConfiguration
for this thing- Returns:
- the
ThingBuilder
itself
-
withBridge
Description copied from class:ThingBuilder
Set the bridge for this thing- Overrides:
withBridge
in classThingBuilder
- Parameters:
bridgeUID
- theThingUID
of the bridge for the thing- Returns:
- the
ThingBuilder
itself
-
withProperties
Description copied from class:ThingBuilder
Set/replace the properties for this thing- Overrides:
withProperties
in classThingBuilder
- Parameters:
properties
- aMap<String,
containing the propertiesString> - Returns:
- the
ThingBuilder
itself
-
withLocation
Description copied from class:ThingBuilder
Set the location for this thing- Overrides:
withLocation
in classThingBuilder
- Parameters:
location
- a string wih the location of the thing- Returns:
- the
ThingBuilder
itself
-