Class CoverageStatistics
java.lang.Object
io.jenkins.plugins.coverage.metrics.model.CoverageStatistics
Provides statistics for values and differences for all Base the different mappings of coverage metric and baseline to actual values.
-
Constructor Summary
ConstructorsConstructorDescriptionCoverageStatistics(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 ofCoverageStatistics. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsValue(edu.hm.hafner.coverage.Metric metric) Returns whether a value for the specified metric and baseline is available in the project.booleancontainsValue(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>Returns the value for the specified baseline and metric.doubleroundValue(edu.hm.hafner.coverage.Metric metric) Returns the rounded value for metric in the project.doubleroundValue(Baseline baseline, edu.hm.hafner.coverage.Metric metric) Returns the rounded value for the specified baseline and metric.
-
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 ofCoverageStatistics.- Parameters:
projectValueMapping- mapping of metrics to values forBaseline.PROJECTprojectDeltaMapping- mapping of metrics to delta values forBaseline.PROJECT_DELTAmodifiedLinesValueMapping- mapping of metrics to values forBaseline.MODIFIED_LINESmodifiedLinesDeltaMapping- mapping of metrics to delta values forBaseline.MODIFIED_LINES_DELTAmodifiedFilesValueMapping- mapping of metrics to values forBaseline.MODIFIED_FILESmodifiedFilesDeltaMapping- mapping of metrics to delta values forBaseline.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 valuemetric- the metric of the value- Returns:
- the value, if available
-
roundValue
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 valuemetric- 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
Returns whether a value for the specified metric and baseline is available.- Parameters:
metric- the metric of the valuebaseline- the baseline of the value- Returns:
true, if a value is available,falseotherwise
-
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,falseotherwise
-