Package com.google.gerrit.server.rules
Interface SubmitRule
-
- All Known Implementing Classes:
DefaultSubmitRule,IgnoreSelfApprovalRule,PrologRule
public interface SubmitRuleAllows plugins to decide whether a change is ready to be submitted or not.For a given
ChangeData, each plugin is called and returns aOptionalofSubmitRecord.A Change can only be submitted if all the plugins give their consent.
Each
SubmitRecordrepresents a decision made by the plugin. If the plugin rejects a change, it should hold valuable informations to help the end user understand and correct the blocking points.It should be noted that each plugin can handle rules inheritance.
This interface should be used to write pre-submit validation rules. This includes both simple checks, coded in Java, and more complex fully fledged expression evaluators (think: Prolog, JavaCC, or even JavaScript rules).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<SubmitRecord>evaluate(ChangeData changeData)Returns aOptionalofSubmitRecordstatus for the change.
-
-
-
Method Detail
-
evaluate
Optional<SubmitRecord> evaluate(ChangeData changeData)
Returns aOptionalofSubmitRecordstatus for the change.Optional#empty()if the SubmitRule was a no-op.
-
-