Class Coverage.CoverageBuilder
- java.lang.Object
-
- com.parasoft.findings.jenkins.coverage.model.Coverage.CoverageBuilder
-
-
Constructor Summary
Constructors Constructor Description CoverageBuilder()
Creates a newCoverage.CoverageBuilder
with all properties unset.CoverageBuilder(Coverage existing)
Creates a newCoverage.CoverageBuilder
with all properties set to the value of the provided existing instance.CoverageBuilder(Metric metric)
Creates a newCoverage.CoverageBuilder
with the specified metric.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Coverage
build()
Creates the newCoverage
instance.void
incrementCovered()
Increments the number of covered items by 1.void
incrementMissed()
Increments the number of missed items by 1.Coverage.CoverageBuilder
setCovered(int covered)
Sets the number of covered items.Coverage.CoverageBuilder
setCovered(String covered)
Sets the number of covered items.Coverage.CoverageBuilder
setMetric(Metric metric)
Sets the metric of the coverage.Coverage.CoverageBuilder
setMetric(String metric)
Sets the metric of the coverage.Coverage.CoverageBuilder
setMissed(int missed)
Sets the number of missed items.Coverage.CoverageBuilder
setMissed(String missed)
Sets the number of missed items.Coverage.CoverageBuilder
setTotal(int total)
Sets the number of total items.Coverage.CoverageBuilder
setTotal(String total)
Sets the number of total items.
-
-
-
Constructor Detail
-
CoverageBuilder
public CoverageBuilder()
Creates a newCoverage.CoverageBuilder
with all properties unset.
-
CoverageBuilder
public CoverageBuilder(@CheckForNull Metric metric)
Creates a newCoverage.CoverageBuilder
with the specified metric. All other properties are unset.- Parameters:
metric
- the metric to set
-
CoverageBuilder
public CoverageBuilder(Coverage existing)
Creates a newCoverage.CoverageBuilder
with all properties set to the value of the provided existing instance.- Parameters:
existing
- the existing coverage to copy all properties from
-
-
Method Detail
-
setMetric
@CanIgnoreReturnValue public Coverage.CoverageBuilder setMetric(Metric metric)
Sets the metric of the coverage.- Parameters:
metric
- the metric of the coverage- Returns:
- this
-
setMetric
@CanIgnoreReturnValue public Coverage.CoverageBuilder setMetric(String metric)
Sets the metric of the coverage.- Parameters:
metric
- the metric of the coverage- Returns:
- this
-
setTotal
@CanIgnoreReturnValue public Coverage.CoverageBuilder setTotal(int total)
Sets the number of total items.- Parameters:
total
- the number of total items- Returns:
- this
-
setTotal
@CanIgnoreReturnValue public Coverage.CoverageBuilder setTotal(String total)
Sets the number of total items.- Parameters:
total
- the number of total items- Returns:
- this
-
setCovered
@CanIgnoreReturnValue public Coverage.CoverageBuilder setCovered(int covered)
Sets the number of covered items.- Parameters:
covered
- the number of covered items- Returns:
- this
-
setCovered
@CanIgnoreReturnValue public Coverage.CoverageBuilder setCovered(String covered)
Sets the number of covered items.- Parameters:
covered
- the number of covered items- Returns:
- this
-
setMissed
@CanIgnoreReturnValue public Coverage.CoverageBuilder setMissed(int missed)
Sets the number of missed items.- Parameters:
missed
- the number of missed items- Returns:
- this
-
setMissed
@CanIgnoreReturnValue public Coverage.CoverageBuilder setMissed(String missed)
Sets the number of missed items.- Parameters:
missed
- the number of missed items- Returns:
- this
-
incrementCovered
public void incrementCovered()
Increments the number of covered items by 1.
-
incrementMissed
public void incrementMissed()
Increments the number of missed items by 1.
-
-