Record Class SourceFileInfo
java.lang.Object
java.lang.Record
org.ek9lang.cli.coverage.model.SourceFileInfo
- Record Components:
filePath- The relative path to the source filemoduleName- The EK9 module name this file belongs tolineCoverage- Map of line numbers to their coverage informationcoveredCount- Number of lines that were coveredtotalCount- Total number of coverable lines
-
Constructor Summary
ConstructorsConstructorDescriptionSourceFileInfo(String filePath, String moduleName, Map<Integer, LineCoverage> lineCoverage, int coveredCount, int totalCount) Creates an instance of aSourceFileInforecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleCalculate the coverage percentage for this file.intReturns the value of thecoveredCountrecord component.final booleanIndicates whether some other object is "equal to" this one.filePath()Returns the value of thefilePathrecord component.final inthashCode()Returns a hash code value for this object.booleanCheck if this file has full coverage.Returns the value of thelineCoveragerecord component.Returns the value of themoduleNamerecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalCountrecord component.intGet the number of uncovered lines.
-
Constructor Details
-
SourceFileInfo
public SourceFileInfo(String filePath, String moduleName, Map<Integer, LineCoverage> lineCoverage, int coveredCount, int totalCount) Creates an instance of aSourceFileInforecord class.- Parameters:
filePath- the value for thefilePathrecord componentmoduleName- the value for themoduleNamerecord componentlineCoverage- the value for thelineCoveragerecord componentcoveredCount- the value for thecoveredCountrecord componenttotalCount- the value for thetotalCountrecord component
-
-
Method Details
-
coveragePercentage
public double coveragePercentage()Calculate the coverage percentage for this file.- Returns:
- Coverage percentage (0-100), or 0 if no coverable lines
-
isFullyCovered
public boolean isFullyCovered()Check if this file has full coverage.- Returns:
- true if all coverable lines were covered
-
uncoveredCount
public int uncoveredCount()Get the number of uncovered lines.- Returns:
- Number of lines not covered
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
filePath
-
moduleName
Returns the value of themoduleNamerecord component.- Returns:
- the value of the
moduleNamerecord component
-
lineCoverage
Returns the value of thelineCoveragerecord component.- Returns:
- the value of the
lineCoveragerecord component
-
coveredCount
public int coveredCount()Returns the value of thecoveredCountrecord component.- Returns:
- the value of the
coveredCountrecord component
-
totalCount
public int totalCount()Returns the value of thetotalCountrecord component.- Returns:
- the value of the
totalCountrecord component
-