Class QualityGateEvaluator<T extends QualityGate>

java.lang.Object
io.jenkins.plugins.util.QualityGateEvaluator<T>
Type Parameters:
T - the concrete type of the quality gates

public abstract class QualityGateEvaluator<T extends QualityGate> extends Object
Evaluates a given set of quality gates.
Author:
Johannes Walter
  • Constructor Details

    • QualityGateEvaluator

      protected QualityGateEvaluator(Collection<? extends T> qualityGates)
      Creates a new quality evaluator for the specified quality gates.
      Parameters:
      qualityGates - the quality gates to evaluate
  • Method Details

    • evaluate

      public QualityGateResult evaluate(ResultHandler resultHandler, edu.hm.hafner.util.FilteredLog log)
      Enforces the quality gates for the specified run.
      Parameters:
      resultHandler - the result handler to publish the result
      log - the logger
      Returns:
      result of the evaluation, expressed by a build state
    • evaluate

      protected abstract void evaluate(T qualityGate, QualityGateResult result)
    • addAll

      public void addAll(Collection<? extends T> additionalQualityGates)
      Appends all the specified quality gates to the end of the existing quality gates.
      Parameters:
      additionalQualityGates - the quality gates to add
    • isEnabled

      public boolean isEnabled()
      Returns whether at least one quality gate has been added.
      Returns:
      true if at least one quality gate has been added, false otherwise