ThingTypeBuilder getBuilder() { return ThingTypeBuilder.instance(thingTypeUID, label) // .withSupportedBridgeTypeUIDs(supportedBridgeTypeUIDs) // .withDescription(description) // .withCategory(category) // .isListed(listed) // .withRepresentationProperty(representationProperty) // .withChannelDefinitions(toChannelDefinitions(channelTypeReferences)) // .withChannelGroupDefinitions(toChannelGroupDefinitions(channelGroupTypeReferences)) // .withProperties(toPropertiesMap()) // .withConfigDescriptionURI(configDescriptionURI) // .withExtensibleChannelTypeIds(extensibleChannelTypeIds); // }
/** * Create and return a {@link ThingTypeBuilder} with the given {@code bindingId}, {@code thingTypeId} and * {@code label}. Also, {@code listed} defaults to {@code true}. * * @param bindingId the binding Id the resulting {@link ThingType} will have. Must not be null or empty. * @param thingTypeId the thingTypeId the resulting {@link ThingType} will have (builds a {@link ThingTypeUID} with * {@code bindingId:thingTypeId}. Must not be null or empty. * @param label the label of the resulting {@link ThingType}. Must not be null or empty. * @return the new {@link ThingTypeBuilder}. */ public static ThingTypeBuilder instance(String bindingId, String thingTypeId, String label) { return new ThingTypeBuilder(bindingId, thingTypeId, label); }
locale); ThingTypeBuilder builder = ThingTypeBuilder.instance(thingType); if (label != null) { builder.withLabel(label); builder.withDescription(description); builder.withChannelDefinitions(localizedChannelDefinitions) .withChannelGroupDefinitions(localizedChannelGroupDefinitions); return builder.buildBridge(); return builder.build();
@Override public BridgeType toThingType() throws ConversionException { return getBuilder().buildBridge(); }
public ThingType toThingType() throws ConversionException { return getBuilder().build(); }
/** * Create this builder with all properties from the given {@link ThingType}. * * @param thingType take all properties from this {@link ThingType}. * @return a new {@link ThingTypeBuilder} configured with all properties from the given {@link ThingType}; * @return the new {@link ThingTypeBuilder}. */ public static ThingTypeBuilder instance(ThingType thingType) { return new ThingTypeBuilder(thingType); }
/** * Create and return a {@link ThingTypeBuilder} with the given {@link ThingTypeUID} and {@code label}. Also, * {@code listed} defaults to {@code true}. * * @param thingTypeUID the {@link ThingTypeUID} the resulting {@link ThingType} will have. Must not be null. * @param label the label of the resulting {@link ThingType}. Must not be null or empty. * @return the new {@link ThingTypeBuilder}. */ public static ThingTypeBuilder instance(ThingTypeUID thingTypeUID, String label) { return new ThingTypeBuilder(thingTypeUID.getBindingId(), thingTypeUID.getId(), label); }