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
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic classBuilder to create an cache newCoverageinstances. -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final CoverageNull 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.booleanFormats 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).intReturns the number of covered items.org.apache.commons.lang3.math.FractionReturns the covered percentage as aFractionin the range of[0, 1].Returns the covered percentage as aCoveragePercentagein the range of[0, 100].intReturns the number of missed items.org.apache.commons.lang3.math.FractionReturns the missed percentage as aFractionin the range of[0, 1].Returns the missed percentage as aCoveragePercentagein the range of[0, 100].intReturns the covered percentage as rounded integer value in the range of[0, 100].intgetTotal()inthashCode()booleanisSet()Returns a string representation for thisCoveragethat can be used to serialize this instance in a simple but still readable way.toString()static CoverageCreates a newCoverageinstance from the provided string representation.
-
Felddetails
-
NO_COVERAGE
Null object that indicates that the code coverage has not been measured.
-
-
Methodendetails
-
valueOf
Creates a newCoverageinstance 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 aFractionin the range of[0, 1].- Gibt zurück:
- the covered percentage
-
getCoveredPercentage
Returns the covered percentage as aCoveragePercentagein 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 aFractionin the range of[0, 1].- Gibt zurück:
- the missed percentage
-
getMissedPercentage
Returns the missed percentage as aCoveragePercentagein 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 thisCoveragethat 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
-