Search in sources :

Example 1 with SubmitRecordAttribute

use of com.google.gerrit.server.data.SubmitRecordAttribute in project gerrit by GerritCodeReview.

the class EventFactory method addSubmitRecords.

/**
   * Add submitRecords to an existing ChangeAttribute.
   *
   * @param ca
   * @param submitRecords
   */
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) {
    ca.submitRecords = new ArrayList<>();
    for (SubmitRecord submitRecord : submitRecords) {
        SubmitRecordAttribute sa = new SubmitRecordAttribute();
        sa.status = submitRecord.status.name();
        if (submitRecord.status != SubmitRecord.Status.RULE_ERROR) {
            addSubmitRecordLabels(submitRecord, sa);
        }
        ca.submitRecords.add(sa);
    }
    // Remove empty lists so a confusing label won't be displayed in the output.
    if (ca.submitRecords.isEmpty()) {
        ca.submitRecords = null;
    }
}
Also used : SubmitRecord(com.google.gerrit.common.data.SubmitRecord) SubmitRecordAttribute(com.google.gerrit.server.data.SubmitRecordAttribute)

Aggregations

SubmitRecord (com.google.gerrit.common.data.SubmitRecord)1 SubmitRecordAttribute (com.google.gerrit.server.data.SubmitRecordAttribute)1