Package org.openhab.core.automation.type
Class Output
java.lang.Object
org.openhab.core.automation.type.Output
This class defines meta-information properties, used by the Rule Engine when creating connections between
modules.
Output
s are the exit point of a Module
. They are used as data source for Input
s of other
Module
s.
The meta-information contains:
- name (mandatory) - unique ID in the scope of the
Module
- type (mandatory) - the type of the output data. The value of this meta-info property could be any string that
makes sense for the user, like a fully qualified name of a Java class, or a general description like "temperature",
for example. The type is used to determine which
Input
can be connected to thisOutput
- label (optional) - short id (one word) of the Output.
- description (optional) - user friendly description of the
Output
- default value (optional) - the string representation of the default value of the
Output
. - reference (optional) - reference to data source. It defines what part of complex data (i.e. JavaBean, java.lang.Map etc.) has to be used as value of this output.
An Output
can be connected to more than one Input
with a compatible data type.
- Author:
- Yordan Mihaylov - Initial contribution, Ana Dimova - Initial contribution, Vasil Ilchev - Initial contribution
-
Constructor Summary
ModifierConstructorDescriptionprotected
Output()
Default constructor for deserialization e.g.Constructs anOutput
instance with the specified name and output data type.Output
(String name, String type, String label, String description, Set<String> tags, String reference, String defaultValue) Constructs anOutput
instance with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionThis method is used to get the string representation of the default value of theOutput
.This method is used for getting the long description of theOutput
.getLabel()
This method is used for getting the short description of theOutput
.getName()
This method is used for getting the name ofOutput
.This method is used for getting the reference to data source.getTags()
This method is used for getting the tags of theOutput
.getType()
This method is used to get the type of theOutput
.toString()
-
Constructor Details
-
Output
protected Output()Default constructor for deserialization e.g. by Gson. -
Output
Constructs anOutput
instance with the specified name and output data type.- Parameters:
name
- a unique name of theOutput
.type
- the type of the output data.- Throws:
IllegalArgumentException
- If one of the name or type parameters is null.
-
Output
public Output(String name, String type, String label, String description, Set<String> tags, String reference, String defaultValue) Constructs anOutput
instance with the specified parameters.- Parameters:
name
- a unique name of theOutput
.type
- the type of the output data.label
- a single word description of theOutput
.description
- is a user friendly description of theOutput
.tags
- are associated with theOutput
. The tags add additional restrictions to connections betweenInput
s andOutput
s. TheInput
's tags must be subset of theOutput
's tags to succeed the connection.
For example: When we want to connectInput
toOutput
and both have same java.lang.double data type. The the output has assign "temperature" and "celsius" tags then the input must have at least one of these output's tags (i.e. "temperature") to connect this input to the selectedOutput
.reference
- refers to the data source. It defines what part of complex data should be used as source of thisOutput
.defaultValue
- takes place when there is no runtime value for thisOutput
. Type of the default value must be the type of theOutput
.- Throws:
IllegalArgumentException
- If one of the name or type parameters is null.
-
-
Method Details
-
getName
This method is used for getting the name ofOutput
. It must be unique in scope ofRule
.- Returns:
- name is a unique identifier of the
Output
.
-
getType
This method is used to get the type of theOutput
. It can be any string that makes sense for the user, like a fully qualified name of a Java class, or a general description like "temperature", for example.- Returns:
- the type of the output data.
-
getLabel
This method is used for getting the short description of theOutput
. Usually the label should be a single word description.- Returns:
- label of the Output.
-
getDescription
This method is used for getting the long description of theOutput
.- Returns:
- user friendly description of the
Output
.
-
getReference
This method is used for getting the reference to data source. It defines what part of complex data (i.e. JavaBean, java.lang.Map etc.) has to be used as a value of thisOutput
. For example, in theOutput
data - java.lang.Map, the reference points to the property that has to be used as an output value.- Returns:
- a reference to data source.
-
getTags
This method is used for getting the tags of theOutput
. The tags add additional restrictions to connections betweenInput
s andOutput
s. The input tags must be subset of the output tags to succeed the connection.
For example: When we want to connectInput
toOutput
and they both have same data type - java.lang.double and theOutput
has assign "temperature" and "celsius" tags, then theInput
must have at least one of theseOutput
's tags (i.e. "temperature") to connect thisInput
to the selectedOutput
.- Returns:
- the tags, associated with this
Input
.
-
getDefaultValue
This method is used to get the string representation of the default value of theOutput
. It is used when there is no runtime value for thisOutput
. It must be compatible with the type of theOutput
.- Returns:
- the string representation of the default value of this
Output
.
-
toString
-