Class QualityGate

    • Constructor Detail

      • QualityGate

        @DataBoundConstructor
        public QualityGate​(int threshold,
                           QualityGate.QualityGateType type,
                           boolean unstable)
        Creates a new instance of QualityGate.
        Parameters:
        threshold - the minimum number of issues that fails the quality gate
        type - the type of the quality gate
        unstable - determines whether the build result will be set to unstable or failed if the quality gate is failed
      • QualityGate

        public QualityGate​(int threshold,
                           QualityGate.QualityGateType type,
                           QualityGate.QualityGateResult result)
        Creates a new instance of QualityGate.
        Parameters:
        threshold - the minimum number of issues that fails the quality gate
        type - the type of the quality gate
        result - determines whether the quality gate is a warning or failure
    • Method Detail

      • getUnstable

        public boolean getUnstable()
      • getWarning

        public boolean getWarning()
      • getThreshold

        public int getThreshold()
        Returns the minimum number of issues that will fail the quality gate.
        Returns:
        minimum number of issues
      • getActualSizeMethodReference

        public Function<IssuesStatistics,​Integer> getActualSizeMethodReference()
        Returns the method that should be used to determine the actual number of issues in the build.
        Returns:
        threshold getter
      • getName

        public String getName()
        Returns the human-readable name of the quality gate.
        Returns:
        the human-readable name
      • getStatus

        public QualityGateStatus getStatus()
        Returns the quality gate status to set if the quality gate is failed.
        Returns:
        the status
      • getResult

        public QualityGate.QualityGateResult getResult()
        Returns the quality gate status to set if the quality gate is failed.
        Returns:
        the status
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • map

        public static List<QualityGate> map​(@CheckForNull
                                            Thresholds thresholds)
        Maps the old style Thresholds to the new style list of QualityGate instances.
        Parameters:
        thresholds - the thresholds
        Returns:
        the list of quality gates