Search in sources :

Example 1 with SubmitRequirementExpressionInfo

use of com.google.gerrit.extensions.common.SubmitRequirementExpressionInfo in project gerrit by GerritCodeReview.

the class SubmitRequirementsJson method submitRequirementExpressionToInfo.

private static SubmitRequirementExpressionInfo submitRequirementExpressionToInfo(SubmitRequirementExpression expression, SubmitRequirementExpressionResult result, boolean hide) {
    SubmitRequirementExpressionInfo info = new SubmitRequirementExpressionInfo();
    info.expression = hide ? null : expression.expressionString();
    info.fulfilled = result.status().equals(SubmitRequirementExpressionResult.Status.PASS);
    info.passingAtoms = hide ? null : result.passingAtoms();
    info.failingAtoms = hide ? null : result.failingAtoms();
    info.errorMessage = result.errorMessage().isPresent() ? result.errorMessage().get() : null;
    return info;
}
Also used : SubmitRequirementExpressionInfo(com.google.gerrit.extensions.common.SubmitRequirementExpressionInfo)

Aggregations

SubmitRequirementExpressionInfo (com.google.gerrit.extensions.common.SubmitRequirementExpressionInfo)1