Class SubmitRuleEvaluator


  • public class SubmitRuleEvaluator
    extends Object
    Evaluates a submit-like Prolog rule found in the rules.pl file of the current project and filters the results through rules found in the parent projects, all the way up to All-Projects.
    • Method Detail

      • getOptions

        public SubmitRuleOptions getOptions()
        Returns:
        immutable snapshot of options configured so far. If neither getSubmitRule() nor getSubmitType() have been called yet, state within this instance is still mutable, so may change before evaluation. The instance's options are frozen at evaluation time.
      • setFastEvalLabels

        public SubmitRuleEvaluator setFastEvalLabels​(boolean fast)
        Parameters:
        fast - if true assume reviewers are permitted to use label values currently stored on the change. Fast mode bypasses some reviewer permission checks.
        Returns:
        this
      • setAllowClosed

        public SubmitRuleEvaluator setAllowClosed​(boolean allow)
        Parameters:
        allow - whether to allow evaluate() on closed changes.
        Returns:
        this
      • setSkipSubmitFilters

        public SubmitRuleEvaluator setSkipSubmitFilters​(boolean skip)
        Parameters:
        skip - if true, submit filter will not be applied.
        Returns:
        this
      • setRule

        public SubmitRuleEvaluator setRule​(String rule)
        Parameters:
        rule - custom rule to use, or null to use refs/meta/config:rules.pl.
        Returns:
        this
      • setLogErrors

        public SubmitRuleEvaluator setLogErrors​(boolean log)
        Parameters:
        log - whether to log error messages in addition to returning error records. If true, error record messages will be less descriptive.
      • getReductionsConsumed

        public long getReductionsConsumed()
        Returns:
        Prolog reductions consumed during evaluation.
      • evaluate

        public List<SubmitRecord> evaluate()
        Evaluate the submit rules.
        Returns:
        List of SubmitRecord objects returned from the evaluated rules, including any errors.
      • getSubmitType

        public SubmitTypeRecord getSubmitType()
        Evaluate the submit type rules to get the submit type.
        Returns:
        record from the evaluated rules.
      • getSubmitRule

        public com.googlecode.prolog_cafe.lang.Term getSubmitRule()
      • getSubmitRuleName

        public String getSubmitRuleName()