Package com.google.gerrit.server.rules
Interface SubmitRule
-
- All Known Implementing Classes:
DefaultSubmitRule
,IgnoreSelfApprovalRule
,PrologRule
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 aOptional
ofSubmitRecord
.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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<SubmitRecord>
evaluate(ChangeData changeData)
Returns aOptional
ofSubmitRecord
status for the change.
-
-
-
Method Detail
-
evaluate
Optional<SubmitRecord> evaluate(ChangeData changeData)
Returns aOptional
ofSubmitRecord
status for the change.Optional#empty()
if the SubmitRule was a no-op.
-
-