Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
override methods to keep type information (#1911)
Browse files Browse the repository at this point in the history
Bug: #1908

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
  • Loading branch information
maggu2810 authored and kaikreuzer committed Jul 25, 2016
1 parent d7d7f3c commit f9595bb
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
package org.eclipse.smarthome.core.thing.binding.builder;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.eclipse.smarthome.config.core.Configuration;
import org.eclipse.smarthome.core.thing.Bridge;
import org.eclipse.smarthome.core.thing.Channel;
import org.eclipse.smarthome.core.thing.ThingTypeUID;
Expand All @@ -20,6 +23,7 @@
*
* @author Dennis Nobel - Initial contribution and API
* @author Kai Kreuzer - Refactoring to make BridgeBuilder a subclass of ThingBuilder
* @author Markus Rathgeb - Override methods to return BridgeBuidler instead of ThingBuidler
*
*/
public class BridgeBuilder extends ThingBuilder {
Expand Down Expand Up @@ -49,4 +53,45 @@ public static BridgeBuilder create(ThingTypeUID thingTypeUID, ThingUID thingUID)
public Bridge build() {
return (Bridge) super.build();
}

@Override
public BridgeBuilder withLabel(String label) {
return (BridgeBuilder) super.withLabel(label);
}

@Override
public BridgeBuilder withChannel(Channel channel) {
return (BridgeBuilder) super.withChannel(channel);
}

@Override
public BridgeBuilder withChannels(Channel... channels) {
return (BridgeBuilder) super.withChannels(channels);
}

@Override
public BridgeBuilder withChannels(List<Channel> channels) {
return (BridgeBuilder) super.withChannels(channels);
}

@Override
public BridgeBuilder withConfiguration(Configuration thingConfiguration) {
return (BridgeBuilder) super.withConfiguration(thingConfiguration);
}

@Override
public BridgeBuilder withBridge(ThingUID bridgeUID) {
return (BridgeBuilder) super.withBridge(bridgeUID);
}

@Override
public BridgeBuilder withProperties(Map<String, String> properties) {
return (BridgeBuilder) super.withProperties(properties);
}

@Override
public BridgeBuilder withLocation(String location) {
return (BridgeBuilder) super.withLocation(location);
}

}

0 comments on commit f9595bb

Please sign in to comment.