Class CoverageStatistics

java.lang.Object
io.jenkins.plugins.coverage.metrics.model.CoverageStatistics

public class CoverageStatistics extends Object
Provides statistics for values and differences for all Base the different mappings of coverage metric and baseline to actual values.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CoverageStatistics(List<? extends edu.hm.hafner.coverage.Value> projectValueMapping, List<? extends edu.hm.hafner.coverage.Difference> projectDeltaMapping, List<? extends edu.hm.hafner.coverage.Value> modifiedLinesValueMapping, List<? extends edu.hm.hafner.coverage.Difference> modifiedLinesDeltaMapping, List<? extends edu.hm.hafner.coverage.Value> modifiedFilesValueMapping, List<? extends edu.hm.hafner.coverage.Difference> modifiedFilesDeltaMapping)
    Creates a new instance of CoverageStatistics.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    containsValue(edu.hm.hafner.coverage.Metric metric)
    Returns whether a value for the specified metric and baseline is available in the project.
    boolean
    containsValue(edu.hm.hafner.coverage.Metric metric, Baseline baseline)
    Returns whether a value for the specified metric and baseline is available.
    Optional<edu.hm.hafner.coverage.Value>
    getValue(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
    Returns the value for the specified baseline and metric.
    double
    roundValue(edu.hm.hafner.coverage.Metric metric)
    Returns the rounded value for metric in the project.
    double
    roundValue(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
    Returns the rounded value for the specified baseline and metric.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CoverageStatistics

      public CoverageStatistics(List<? extends edu.hm.hafner.coverage.Value> projectValueMapping, List<? extends edu.hm.hafner.coverage.Difference> projectDeltaMapping, List<? extends edu.hm.hafner.coverage.Value> modifiedLinesValueMapping, List<? extends edu.hm.hafner.coverage.Difference> modifiedLinesDeltaMapping, List<? extends edu.hm.hafner.coverage.Value> modifiedFilesValueMapping, List<? extends edu.hm.hafner.coverage.Difference> modifiedFilesDeltaMapping)
      Creates a new instance of CoverageStatistics.
      Parameters:
      projectValueMapping - mapping of metrics to values for Baseline.PROJECT
      projectDeltaMapping - mapping of metrics to delta values for Baseline.PROJECT_DELTA
      modifiedLinesValueMapping - mapping of metrics to values for Baseline.MODIFIED_LINES
      modifiedLinesDeltaMapping - mapping of metrics to delta values for Baseline.MODIFIED_LINES_DELTA
      modifiedFilesValueMapping - mapping of metrics to values for Baseline.MODIFIED_FILES
      modifiedFilesDeltaMapping - mapping of metrics to delta values for Baseline.MODIFIED_FILES_DELTA
  • Method Details

    • getValue

      public Optional<edu.hm.hafner.coverage.Value> getValue(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns the value for the specified baseline and metric.
      Parameters:
      baseline - the baseline of the value
      metric - the metric of the value
      Returns:
      the value, if available
    • roundValue

      public double roundValue(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns the rounded value for the specified baseline and metric. If the value is not available, 0.0 is returned.
      Parameters:
      baseline - the baseline of the value
      metric - the metric of the value
      Returns:
      the value, if available
    • roundValue

      public double roundValue(edu.hm.hafner.coverage.Metric metric)
      Returns the rounded value for metric in the project. If the value is not available, 0.0 is returned.
      Parameters:
      metric - the metric of the value
      Returns:
      the value, if available
    • containsValue

      public boolean containsValue(edu.hm.hafner.coverage.Metric metric, Baseline baseline)
      Returns whether a value for the specified metric and baseline is available.
      Parameters:
      metric - the metric of the value
      baseline - the baseline of the value
      Returns:
      true, if a value is available, false otherwise
    • containsValue

      public boolean containsValue(edu.hm.hafner.coverage.Metric metric)
      Returns whether a value for the specified metric and baseline is available in the project.
      Parameters:
      metric - the metric of the value
      Returns:
      true, if a value is available, false otherwise