Package com.isode.dsapi.config
Class DSACreationTemplate.OptRuleLimit
java.lang.Object
com.isode.dsapi.config.DSACreationTemplate.OptRuleLimit
- Enclosing class:
- DSACreationTemplate
Limit on optional rules.
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
If true, then at least one of these rules must be present.boolean
If true, then at most one of these rules must be present.int[]
Precedences of rules that are affected by the limit. -
Constructor Summary
ConstructorsConstructorDescriptionOptRuleLimit
(String precs_str, boolean at_least_one, boolean at_most_one) Construct the object based on a text-based precedence string. -
Method Summary
Modifier and TypeMethodDescriptionGet the precedences as a comma-separated string.boolean
isValid
(List<DSACreationTemplate.OptRule> or_list) Test whether the selections in the given list of OptRule instances are valid according to this limit.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).
-
Field Details
-
precs
public int[] precsPrecedences of rules that are affected by the limit. -
at_least_one
public boolean at_least_oneIf true, then at least one of these rules must be present. -
at_most_one
public boolean at_most_oneIf true, then at most one of these rules must be present.
-
-
Constructor Details
-
OptRuleLimit
Construct the object based on a text-based precedence string.
-
-
Method Details
-
getPrecsStr
Get the precedences as a comma-separated string. -
isValid
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
- Listto scan sel_or
- OptRule to keep selected
-