Class DSACreationTemplate.OptRuleLimit

java.lang.Object
com.isode.dsapi.config.DSACreationTemplate.OptRuleLimit
Enclosing class:
DSACreationTemplate

public static class DSACreationTemplate.OptRuleLimit extends Object
Limit on optional rules.
  • Field Details

    • precs

      public int[] precs
      Precedences of rules that are affected by the limit.
    • at_least_one

      public boolean at_least_one
      If true, then at least one of these rules must be present.
    • at_most_one

      public boolean at_most_one
      If true, then at most one of these rules must be present.
  • Constructor Details

    • OptRuleLimit

      public OptRuleLimit(String precs_str, boolean at_least_one, boolean at_most_one)
      Construct the object based on a text-based precedence string.
  • Method Details

    • getPrecsStr

      public String getPrecsStr()
      Get the precedences as a comma-separated string.
    • isValid

      public boolean isValid(List<DSACreationTemplate.OptRule> or_list)
      Test whether the selections in the given list of OptRule instances are valid according to this limit.
    • makeValid

      public void makeValid(List<DSACreationTemplate.OptRule> or_list, DSACreationTemplate.OptRule sel_or)
      Make selections valid in the given or_list, keeping the given OptRule selected (assuming that it is already selected). Only handles at-most-one limits.
      Parameters:
      or_list - List to scan
      sel_or - OptRule to keep selected