Class TriggerType

java.lang.Object
org.openhab.core.automation.type.ModuleType
org.openhab.core.automation.type.TriggerType
All Implemented Interfaces:
Identifiable<String>
Direct Known Subclasses:
CompositeTriggerType

@NonNullByDefault public class TriggerType extends ModuleType
This class provides common functionality for creating Trigger instances by supplying their meta-information. Each TriggerType is uniquely identifiable in scope of the ModuleTypeRegistry and defines ConfigDescriptionParameters that are meta-information for configuration of the future Trigger instances and meta-information for Outputs used from these Trigger instances.
Author:
Yordan Mihaylov - Initial contribution
  • Constructor Details

    • TriggerType

      public TriggerType(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions, @Nullable List<Output> outputs)
      Creates an instance of TriggerType with base properties - UID, a List of configuration descriptions and a List of Output descriptions.
      Parameters:
      uid - the TriggerType's identifier, or null if a random identifier should be generated.
      configDescriptions - describing meta-data for the configuration of the future Trigger instances.
      outputs - a List with Output meta-information descriptions of the future Trigger instances.
    • TriggerType

      public TriggerType(@Nullable String uid, @Nullable List<ConfigDescriptionParameter> configDescriptions, @Nullable String label, @Nullable String description, @Nullable Set<String> tags, @Nullable Visibility visibility, @Nullable List<Output> outputs)
      Creates an instance of TriggerType with UID, label, description, a Set of tags, visibility, a List of configuration descriptions and a List of Output descriptions.
      Parameters:
      uid - the TriggerType's identifier, or null if a random identifier should be generated.
      configDescriptions - describing meta-data for the configuration of the future Trigger instances.
      label - a short and accurate, human-readable label of the TriggerType.
      description - a detailed, human-readable description of usage of TriggerType and its benefits.
      tags - defines categories that fit the TriggerType and which can serve as criteria for searching or filtering it.
      visibility - determines whether the TriggerType can be used by anyone if it is Visibility.VISIBLE or only by its creator if it is Visibility.HIDDEN. If null is provided the default visibility Visibility.VISIBLE will be used.
      outputs - a List with Output meta-information descriptions of the future Trigger instances.
  • Method Details

    • getOutputs

      public List<Output> getOutputs()
      Gets the meta-information descriptions of Outputs defined by this type.
      Returns:
      a List of Output definitions.