use of com.google.gerrit.entities.SubmitRequirementExpressionResult.PredicateResult in project gerrit by GerritCodeReview.
the class SubmitRequirementsEvaluatorImpl method evaluateExpression.
@Override
public SubmitRequirementExpressionResult evaluateExpression(SubmitRequirementExpression expression, ChangeData changeData) {
try {
Predicate<ChangeData> predicate = queryBuilder.get().parse(expression.expressionString());
PredicateResult predicateResult = evaluatePredicateTree(predicate, changeData);
return SubmitRequirementExpressionResult.create(expression, predicateResult);
} catch (QueryParseException | SubmitRequirementEvaluationException e) {
return SubmitRequirementExpressionResult.error(expression, e.getMessage());
}
}
Aggregations