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 ConfigDescriptionParameter
s, Input
s and Output
s of a
Module
. Each ModuleType
instance owns a unique id which is used as reference in the Module
s,
to find their meta-information.
Whether the ModuleType
s 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
Modifier and TypeFieldDescriptionprotected List<ConfigDescriptionParameter>
Describes meta-data for the configuration of the futureModule
instances. -
Constructor Summary
ConstructorDescriptionModuleType
(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions) Creates aModuleType
instance.ModuleType
(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions, @Nullable String label, @Nullable String description, @Nullable Set<String> tags, @Nullable Visibility visibility) Creates aModuleType
instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the meta-data for the configuration of the futureModule
instances.@Nullable String
Gets the description of theModuleType
.@Nullable String
getLabel()
Gets the label of theModuleType
.getTags()
Gets the assigned to theModuleType
-tags
.getUID()
Gets theModuleType
.Gets the visibility of theModuleType
.int
hashCode()
-
Field Details
-
configDescriptions
Describes meta-data for the configuration of the futureModule
instances.
-
-
Constructor Details
-
ModuleType
public ModuleType(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions) Creates aModuleType
instance. This constructor is responsible to initialize common base properties of theModuleType
s.- Parameters:
uid
- theModuleType
's identifier, ornull
if a random identifier should be generated.configDescriptions
- describing meta-data for the configuration of the futureModule
instances
-
ModuleType
public ModuleType(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions, @Nullable String label, @Nullable String description, @Nullable Set<String> tags, @Nullable Visibility visibility) Creates aModuleType
instance. This constructor is responsible to initialize all common properties of theModuleType
s.- Parameters:
uid
- theModuleType
's identifier, ornull
if a random identifier should be generated.configDescriptions
- describing meta-data for the configuration of the futureModule
instances.label
- a short and accurate, human-readable label of theModuleType
.description
- a detailed, human-readable description of usage ofModuleType
and its benefits.tags
- defines categories that fit theModuleType
and which can serve as criteria for searching or filtering it.visibility
- determines whether theModuleType
can be used by anyone if it isVisibility.VISIBLE
or only by its creator if it isVisibility.HIDDEN
. Ifnull
is provided the default visibilityVisibility.VISIBLE
will be used.
-
-
Method Details
-
getUID
Gets theModuleType
. It can be specified by theModuleType
's creator, or randomly generated.- Specified by:
getUID
in interfaceIdentifiable<String>
- Returns:
- an identifier of this
ModuleType
. Can't benull
.
-
getConfigurationDescriptions
Gets the meta-data for the configuration of the futureModule
instances.- Returns:
- a
Set
of 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 theModuleType
s can be used by anyone if they areVisibility.VISIBLE
or only by their creator if they areVisibility.HIDDEN
. The default visibility isVisibility.VISIBLE
.- Returns:
- the
visibility
of theModuleType
.
-
hashCode
public int hashCode() -
equals
-