/** * Builds and returns a new {@link BridgeType} according to the given values from this builder. * * @return a new {@link BridgeType} according to the given values from this builder. * @throws IllegalStateException if one of {@code bindingId}, {@code thingTypeId} or {@code label} are not given. */ public BridgeType buildBridge() { if (StringUtils.isBlank(bindingId)) { throw new IllegalArgumentException("The bindingId must neither be null nor empty."); } if (StringUtils.isBlank(thingTypeId)) { throw new IllegalArgumentException("The thingTypeId must neither be null nor empty."); } if (StringUtils.isBlank(label)) { throw new IllegalArgumentException("The label must neither be null nor empty."); } return new BridgeType(new ThingTypeUID(bindingId, thingTypeId), supportedBridgeTypeUIDs, label, description, category, listed, representationProperty, channelDefinitions, channelGroupDefinitions, properties, configDescriptionURI, extensibleChannelTypeIds); }
BridgeType localizedBridgeType = new BridgeType(bridgeType.getUID(), bridgeType.getSupportedBridgeTypeUIDs(), label, description, thingType.isListed(), localizedChannelDefinitions, localizedChannelGroupDefinitions, thingType.getProperties(), bridgeType.getConfigDescriptionURI()); localizedThingTypeCache.put(localizedThingTypeKey, localizedBridgeType); return localizedBridgeType;
@Override public ThingType toThingType() throws ConversionException { BridgeType bridgeType = new BridgeType(super.thingTypeUID, super.supportedBridgeTypeUIDs, super.label, super.description, super.listed, super.toChannelDefinitions(this.channelTypeReferences), super.toChannelGroupDefinitions(this.channelGroupTypeReferences), super.toPropertiesMap(), super.configDescriptionURI); return bridgeType; }