Package org.openhab.core.automation.type
Class ModuleType
java.lang.Object
org.openhab.core.automation.type.ModuleType
- All Implemented Interfaces:
Identifiable<String>
- Direct Known Subclasses:
ActionType,ConditionType,TriggerType
This class provides common functionality for creating
ModuleType instances. Each ModuleType instance
defines the meta-information needed for creation of a Module instance which is a building block for a
Rule. The meta-information describes the Configuration of a
Module providing list with ConfigDescriptionParameters, Inputs and Outputs of a
Module. Each ModuleType instance owns a unique id which is used as reference in the Modules,
to find their meta-information.
Whether the ModuleTypes can be used by anyone, depends from their Visibility value, but they can be
modified only by their creator.
- Author:
- Yordan Mihaylov - Initial contribution, Ana Dimova - Initial contribution
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ConfigDescriptionParameter> Describes meta-data for the configuration of the futureModuleinstances. -
Constructor Summary
ConstructorsConstructorDescriptionModuleType(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions) Creates aModuleTypeinstance.ModuleType(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions, @Nullable String label, @Nullable String description, @Nullable Set<String> tags, @Nullable Visibility visibility) Creates aModuleTypeinstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the meta-data for the configuration of the futureModuleinstances.@Nullable StringGets the description of theModuleType.@Nullable StringgetLabel()Gets the label of theModuleType.getTags()Gets the assigned to theModuleType-tags.getUID()Gets theModuleType.Gets the visibility of theModuleType.inthashCode()
-
Field Details
-
configDescriptions
Describes meta-data for the configuration of the futureModuleinstances.
-
-
Constructor Details
-
ModuleType
public ModuleType(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions) Creates aModuleTypeinstance. This constructor is responsible to initialize common base properties of theModuleTypes.- Parameters:
uid- theModuleType's identifier, ornullif a random identifier should be generated.configDescriptions- describing meta-data for the configuration of the futureModuleinstances
-
ModuleType
public ModuleType(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions, @Nullable String label, @Nullable String description, @Nullable Set<String> tags, @Nullable Visibility visibility) Creates aModuleTypeinstance. This constructor is responsible to initialize all common properties of theModuleTypes.- Parameters:
uid- theModuleType's identifier, ornullif a random identifier should be generated.configDescriptions- describing meta-data for the configuration of the futureModuleinstances.label- a short and accurate, human-readable label of theModuleType.description- a detailed, human-readable description of usage ofModuleTypeand its benefits.tags- defines categories that fit theModuleTypeand which can serve as criteria for searching or filtering it.visibility- determines whether theModuleTypecan be used by anyone if it isVisibility.VISIBLEor only by its creator if it isVisibility.HIDDEN. Ifnullis provided the default visibilityVisibility.VISIBLEwill be used.
-
-
Method Details
-
getUID
Gets theModuleType. It can be specified by theModuleType's creator, or randomly generated.- Specified by:
getUIDin interfaceIdentifiable<String>- Returns:
- an identifier of this
ModuleType. Can't benull.
-
getConfigurationDescriptions
Gets the meta-data for the configuration of the futureModuleinstances.- Returns:
- a
Setof meta-information configuration descriptions.
-
getTags
Gets the assigned to theModuleType-tags.- Returns:
- a set of tags, assigned to this
ModuleType.
-
getLabel
Gets the label of theModuleType. The label is a short and accurate, human-readable label of theModuleType.- Returns:
- the
ModuleType'slabel. Can benull.
-
getDescription
Gets the description of theModuleType. The description is a short and understandable description of that for what can be used theModuleType.- Returns:
- the
ModuleType'sdescription. Can benull.
-
getVisibility
Gets the visibility of theModuleType. The visibility determines whether theModuleTypes can be used by anyone if they areVisibility.VISIBLEor only by their creator if they areVisibility.HIDDEN. The default visibility isVisibility.VISIBLE.- Returns:
- the
visibilityof theModuleType.
-
hashCode
public int hashCode() -
equals
-