Class SimpleRule

    • Field Detail

      • triggers

        @NonNullByDefault({})
        protected List<Trigger> triggers
      • conditions

        @NonNullByDefault({})
        protected List<Condition> conditions
      • actions

        @NonNullByDefault({})
        protected List<Action> actions
      • configuration

        @NonNullByDefault({})
        protected Configuration configuration
      • templateUID

        protected @Nullable String templateUID
      • uid

        @NonNullByDefault({})
        protected String uid
      • name

        protected @Nullable String name
      • tags

        @NonNullByDefault({})
        protected Set<String> tags
      • visibility

        @NonNullByDefault({})
        protected Visibility visibility
      • description

        protected @Nullable String description
    • Constructor Detail

      • SimpleRule

        public SimpleRule()
    • Method Detail

      • getUID

        public String getUID()
        Description copied from interface: Rule
        This method is used to obtain the identifier of the Rule. It can be specified by the Rule's creator, or randomly generated.
        Specified by:
        getUID in interface Identifiable<String>
        Specified by:
        getUID in interface Rule
        Returns:
        an identifier of this Rule. Can't be null.
      • getTemplateUID

        public @Nullable String getTemplateUID()
        Description copied from interface: Rule
        This method is used to obtain the RuleTemplate identifier of the template the Rule was created from. It will be used by the RuleRegistry to resolve the Rule: to validate the Rule's configuration, as well as to create and configure the Rule's modules. If a Rule has not been created from a template, or has been successfully resolved by the RuleRegistry, this method will return null.
        Specified by:
        getTemplateUID in interface Rule
        Returns:
        the identifier of the Rule's RuleTemplate, or null if the Rule has not been created from a template, or has been successfully resolved by the RuleRegistry.
      • setTemplateUID

        public void setTemplateUID​(@Nullable String templateUID)
        This method is used to specify the RuleTemplate identifier of the template that will be used to by the RuleRegistry to resolve the Rule: to validate the Rule's configuration, as well as to create and configure the Rule's modules.
      • getName

        public @Nullable String getName()
        Description copied from interface: Rule
        This method is used to obtain the Rule's human-readable name.
        Specified by:
        getName in interface Rule
        Returns:
        the Rule's human-readable name, or null.
      • setName

        public void setName​(@Nullable String ruleName)
        This method is used to specify the Rule's human-readable name.
        Parameters:
        ruleName - the Rule's human-readable name, or null.
      • getTags

        public Set<String> getTags()
        Description copied from interface: Rule
        This method is used to obtain the Rule's assigned tags.
        Specified by:
        getTags in interface Rule
        Returns:
        the Rule's assigned tags.
      • setTags

        public void setTags​(@Nullable Set<String> ruleTags)
        This method is used to specify the Rule's assigned tags.
        Parameters:
        ruleTags - the Rule's assigned tags.
      • getDescription

        public @Nullable String getDescription()
        Description copied from interface: Rule
        This method is used to obtain the human-readable description of the purpose and consequences of the Rule's execution.
        Specified by:
        getDescription in interface Rule
        Returns:
        the Rule's human-readable description, or null.
      • setDescription

        public void setDescription​(@Nullable String ruleDescription)
        This method is used to specify human-readable description of the purpose and consequences of the Rule's execution.
        Parameters:
        ruleDescription - the Rule's human-readable description, or null.
      • setConfiguration

        public void setConfiguration​(@Nullable Configuration ruleConfiguration)
        This method is used to specify the Rule's Configuration.
        Parameters:
        ruleConfiguration - the new configuration values.
      • getConditions

        public List<Condition> getConditions()
        Description copied from interface: Rule
        This method is used to get the conditions participating in Rule.
        Specified by:
        getConditions in interface Rule
        Returns:
        a list with the conditions that belong to this Rule.
      • setConditions

        public void setConditions​(@Nullable List<Condition> conditions)
        This method is used to specify the conditions participating in Rule.
        Parameters:
        conditions - a list with the conditions that should belong to this Rule.
      • getActions

        public List<Action> getActions()
        Description copied from interface: Rule
        This method is used to get the actions participating in Rule.
        Specified by:
        getActions in interface Rule
        Returns:
        a list with the actions that belong to this Rule.
      • getTriggers

        public List<Trigger> getTriggers()
        Description copied from interface: Rule
        This method is used to get the triggers participating in Rule.
        Specified by:
        getTriggers in interface Rule
        Returns:
        a list with the triggers that belong to this Rule.
      • setActions

        public void setActions​(@Nullable List<Action> actions)
        This method is used to specify the actions participating in Rule
        Parameters:
        actions - a list with the actions that should belong to this Rule.
      • setTriggers

        public void setTriggers​(@Nullable List<Trigger> triggers)
        This method is used to specify the triggers participating in Rule
        Parameters:
        triggers - a list with the triggers that should belong to this Rule.
      • getModules

        public List<Module> getModules()
        Description copied from interface: Rule
        Obtains the modules of the Rule.
        Specified by:
        getModules in interface Rule
        Returns:
        the modules of the Rule or empty list if the Rule has no modules.
      • getModules

        public <T extends ModuleList<T> getModules​(@Nullable Class<T> moduleClazz)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(@Nullable Object obj)
        Overrides:
        equals in class Object