java.lang.Object
org.ametys.plugins.forms.repository.type.Rule

public class Rule extends Object
Object representing a rule
  • Constructor Details

    • Rule

      public Rule(String id, String option, Rule.QuestionRuleType type)
      The Rule constructor
      Parameters:
      id - the source question's id
      option - the trigger option's value
      type - the action on the target when triggered
  • Method Details

    • getSourceId

      public String getSourceId()
      Get the source question's id
      Returns:
      the question's id
    • setSourceId

      public void setSourceId(String questionId)
      Set the source question's id
      Parameters:
      questionId - the question's id
    • getAction

      Get the action on the target when triggered
      Returns:
      the Rule's action
    • setAction

      public void setAction(Rule.QuestionRuleType type)
      Set the Question Rule type
      Parameters:
      type - the type of _action to set
    • getOption

      public String getOption()
      Get the option value that trigger the action
      Returns:
      the _option
    • setOption

      public void setOption(String option)
      Set the option value that trigger the action
      Parameters:
      option - the _option to set
    • toJson

      public Map<String,Object> toJson()
      Get the rule attributes formated for json export
      Returns:
      a json readable map