Package com.google.gerrit.server.rules
Interface SubmitRule
- All Known Implementing Classes:
DefaultSubmitRule
,IgnoreSelfApprovalRule
public interface SubmitRule
Allows plugins to decide whether a change is ready to be submitted or not.
For a given ChangeData
, each plugin is called and returns a Optional
of SubmitRecord
.
A Change can only be submitted if all the plugins give their consent.
Each SubmitRecord
represents 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
Modifier and TypeMethodDescriptionevaluate
(ChangeData changeData) Returns aOptional
ofSubmitRecord
status for the change.
-
Method Details
-
evaluate
Returns aOptional
ofSubmitRecord
status for the change.Optional#empty()
if the SubmitRule was a no-op.
-