private String inferChannelGroupKey(ChannelGroupTypeUID channelGroupTypeUID, ChannelDefinition channel, String lastSegment) { return "channel-group-type." + channelGroupTypeUID.getBindingId() + "." + channelGroupTypeUID.getId() + ".channel." + channel.getId() + "." + lastSegment; }
/** * Build the {@link ChannelGroupType} with the given values * * @return the created {@link ChannelGroupType} */ public ChannelGroupType build() { return new ChannelGroupType(channelGroupTypeUID, advanced, label, description, category, channelDefinitions); }
/** * Creates a new channel definition builder. * * @param channelDefinition the channel definition the builder should be initialized by */ public ChannelDefinitionBuilder(final ChannelDefinition channelDefinition) { this(channelDefinition.getId(), channelDefinition.getChannelTypeUID()); this.properties = channelDefinition.getProperties(); this.label = channelDefinition.getLabel(); this.description = channelDefinition.getDescription(); this.autoUpdatePolicy = channelDefinition.getAutoUpdatePolicy(); }
/** * Returns a thing type for a given thing type UID. * * @param thingTypeUID thing type UID * @return thing type for given UID or null if no thing type with this UID * was found */ public ThingType getThingType(ThingTypeUID thingTypeUID) { return getThingType(thingTypeUID, null); }
private String inferChannelKey(ChannelTypeUID channelTypeUID, String lastSegment) { return "channel-type." + channelTypeUID.getBindingId() + "." + channelTypeUID.getId() + "." + lastSegment; }
private String inferChannelGroupKey(ChannelGroupTypeUID channelGroupTypeUID, String lastSegment) { return "channel-group-type." + channelGroupTypeUID.getBindingId() + "." + channelGroupTypeUID.getId() + "." + lastSegment; }
/** * Returns thing types for a given binding id. * * @param bindingId binding id * @return thing types for given binding id */ public List<ThingType> getThingTypes(String bindingId) { return getThingTypes(bindingId, null); }
/** * Build a channel definition. * * @return channel definition */ public ChannelDefinition build() { return new ChannelDefinition(id, channelTypeUID, label, description, properties, autoUpdatePolicy); }
/** * Returns all channel types with the default {@link Locale}. * * @return all channel types or empty list if no channel type exists */ public List<ChannelType> getChannelTypes() { return getChannelTypes(null); }
/** * Returns the unique identifier which identifies this Thing type within the overall system. * * @return the unique identifier which identifies this Thing type within the overall system * (not null) */ @Override public ThingTypeUID getUID() { return (ThingTypeUID) super.getUID(); }
/** * 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); }
/** * Returns all channel group types with the default {@link Locale}. * * @return all channel group types or empty list if no channel group type exists */ public List<ChannelGroupType> getChannelGroupTypes() { return getChannelGroupTypes(null); }
private StateDescription getDynamicStateDescription(Channel channel, StateDescription originalStateDescription, Locale locale) { for (DynamicStateDescriptionProvider provider : dynamicStateDescriptionProviders) { StateDescription stateDescription = provider.getStateDescription(channel, originalStateDescription, locale); if (stateDescription != null) { return stateDescription; } } return null; }
/** * Returns the identifier of the channel group. * * @return the identifier of the channel group (neither null, nor empty) */ public String getId() { return getSegment(1); }
/** * Returns the identifier of the channel. * * @return the identifier of the channel (neither null, nor empty) */ public String getId() { return getSegment(1); }
public static ThingType getThingType(ThingTypeUID thingTypeUID) { // Check that we know about the registry if (thingTypeRegistry == null) { return null; } return thingTypeRegistry.getThingType(thingTypeUID); }
/** * Returns all thing types. * * @return all thing types */ public List<ThingType> getThingTypes() { return getThingTypes((Locale) null); }
@Override public ChannelTypeUID getUID() { return (ChannelTypeUID) super.getUID(); }
/** * 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); }
@Override public ChannelGroupTypeUID getUID() { return (ChannelGroupTypeUID) super.getUID(); }