@Override public BridgeBuilder withChannels(Channel... channels) { return (BridgeBuilder) super.withChannels(channels); }
@Override public BridgeBuilder withChannels(List<Channel> channels) { return (BridgeBuilder) super.withChannels(channels); }
public ThingBuilder withChannels(Channel... channels) { return withChannels(Arrays.asList(channels)); }
/** * Creates a thing based on a given thing type. It also creates the * default-configuration given in the configDescriptions if the * configDescriptionRegistry is not null * * @param thingType (must not be null) * @param thingUID (must not be null) * @param configuration (must not be null) * @param bridgeUID (can be null) * @param configDescriptionRegistry (can be null) * @return thing the thing */ public static Thing createThing(ThingType thingType, ThingUID thingUID, Configuration configuration, @Nullable ThingUID bridgeUID, @Nullable ConfigDescriptionRegistry configDescriptionRegistry) { ThingFactoryHelper.applyDefaultConfiguration(configuration, thingType, configDescriptionRegistry); List<Channel> channels = ThingFactoryHelper.createChannels(thingType, thingUID, configDescriptionRegistry); return createThingBuilder(thingType, thingUID).withConfiguration(configuration).withChannels(channels) .withProperties(thingType.getProperties()).withBridge(bridgeUID).build(); }
oldChannelUidList, newChannelUidList); ThingBuilder thingBuilder = editThing(); thingBuilder.withChannels(nodeChannels).withConfiguration(getConfig()); updateThing(thingBuilder.build());
/** * Creates a thing builder, which allows to modify the thing. The method * {@link BaseThingHandler#updateThing(Thing)} must be called to persist the changes. * * @return {@link ThingBuilder} which builds an exact copy of the thing (not null) */ protected ThingBuilder editThing() { return ThingBuilder.create(this.thing.getThingTypeUID(), this.thing.getUID()) .withBridge(this.thing.getBridgeUID()).withChannels(this.thing.getChannels()) .withConfiguration(this.thing.getConfiguration()).withLabel(this.thing.getLabel()) .withLocation(this.thing.getLocation()).withProperties(this.thing.getProperties()); }
thingBuilder.withChannels(channels); Thing thing = thingBuilder.build(); if ((thingFromHandler != null)) {
builder.withChannels(thing.getChannels());