Klasse Coverage
java.lang.Object
io.jenkins.plugins.coverage.model.Coverage
- Alle implementierten Schnittstellen:
Serializable
Value of a code coverage item. The code coverage is measured using the number of covered and missed items. The type
of items (line, instruction, branch, file, etc.) is provided by the companion class
CoverageMetric
.- Autor:
- Ullrich Hafner
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Modifizierer und TypKlasseBeschreibungstatic class
Builder to create an cache newCoverage
instances. -
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final Coverage
Null object that indicates that the code coverage has not been measured. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungAdd the coverage details from the specified instance to the coverage details of this instance.boolean
Formats the covered percentage as String (with a precision of two digits after the comma).formatCoveredPercentage
(Locale locale) Formats the covered percentage as String (with a precision of two digits after the comma).Formats the missed percentage as formatted String (with a precision of two digits after the comma).formatMissedPercentage
(Locale locale) Formats the missed percentage as formatted String (with a precision of two digits after the comma).int
Returns the number of covered items.org.apache.commons.lang3.math.Fraction
Returns the covered percentage as aFraction
in the range of[0, 1]
.Returns the covered percentage as aCoveragePercentage
in the range of[0, 100]
.int
Returns the number of missed items.org.apache.commons.lang3.math.Fraction
Returns the missed percentage as aFraction
in the range of[0, 1]
.Returns the missed percentage as aCoveragePercentage
in the range of[0, 100]
.int
Returns the covered percentage as rounded integer value in the range of[0, 100]
.int
getTotal()
int
hashCode()
boolean
isSet()
Returns a string representation for thisCoverage
that can be used to serialize this instance in a simple but still readable way.toString()
static Coverage
Creates a newCoverage
instance from the provided string representation.
-
Felddetails
-
NO_COVERAGE
Null object that indicates that the code coverage has not been measured.
-
-
Methodendetails
-
valueOf
Creates a newCoverage
instance from the provided string representation. The string representation is expected to contain the number of covered items and the total number of items - separated by a slash, e.g. "100/345", or "0/0". Whitespace characters will be ignored.- Parameter:
stringRepresentation
- string representation to convert from- Gibt zurück:
- the created coverage
- Löst aus:
IllegalArgumentException
- if the string is not a valid Coverage instance
-
getCovered
public int getCovered()Returns the number of covered items.- Gibt zurück:
- the number of covered items
-
getCoveredFraction
public org.apache.commons.lang3.math.Fraction getCoveredFraction()Returns the covered percentage as aFraction
in the range of[0, 1]
.- Gibt zurück:
- the covered percentage
-
getCoveredPercentage
Returns the covered percentage as aCoveragePercentage
in the range of[0, 100]
.- Gibt zurück:
- the covered percentage
-
getRoundedPercentage
public int getRoundedPercentage()Returns the covered percentage as rounded integer value in the range of[0, 100]
.- Gibt zurück:
- the covered percentage
-
formatCoveredPercentage
Formats the covered percentage as String (with a precision of two digits after the comma). UsesLocale.getDefault()
to format the percentage.- Gibt zurück:
- the covered percentage
- Siehe auch:
-
formatCoveredPercentage
Formats the covered percentage as String (with a precision of two digits after the comma).- Parameter:
locale
- the locale to use when formatting the percentage- Gibt zurück:
- the covered percentage
-
getMissed
public int getMissed()Returns the number of missed items.- Gibt zurück:
- the number of missed items
-
getMissedFraction
public org.apache.commons.lang3.math.Fraction getMissedFraction()Returns the missed percentage as aFraction
in the range of[0, 1]
.- Gibt zurück:
- the missed percentage
-
getMissedPercentage
Returns the missed percentage as aCoveragePercentage
in the range of[0, 100]
.- Gibt zurück:
- the missed percentage
-
formatMissedPercentage
Formats the missed percentage as formatted String (with a precision of two digits after the comma). UsesLocale.getDefault()
to format the percentage.- Gibt zurück:
- the missed percentage
-
formatMissedPercentage
Formats the missed percentage as formatted String (with a precision of two digits after the comma).- Parameter:
locale
- the locale to use when formatting the percentage- Gibt zurück:
- the missed percentage
-
add
Add the coverage details from the specified instance to the coverage details of this instance.- Parameter:
additional
- the additional coverage details- Gibt zurück:
- the sum of this and the additional coverage
-
toString
-
getTotal
public int getTotal() -
isSet
public boolean isSet() -
equals
-
hashCode
public int hashCode() -
serializeToString
Returns a string representation for thisCoverage
that can be used to serialize this instance in a simple but still readable way. The serialization contains the number of covered items and the total number of items - separated by a slash, e.g. "100/345", or "0/0".- Gibt zurück:
- a string representation for this
Coverage
-