Record Class CoverageModuleDetails
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.CoverageModuleDetails
- Record Components:
moduleId- Unique identifier for this module (hash-based)moduleName- Fully qualified module namesourceHash- Hash of source content for staleness detectionprobeCount- Total number of probes in this moduleprobes- Detailed information for each probefunctions- Coverage information for each function
public record CoverageModuleDetails(long moduleId, String moduleName, long sourceHash, int probeCount, List<CoverageProbeDetails> probes, List<CoverageFunctionDetails> functions)
extends Record
Represents complete coverage metadata for a compiled module.
This metadata is generated during IR generation when coverage is enabled. It provides all the information needed to:
- Initialize coverage counters at runtime
- Map probe IDs to source locations for reporting
- Calculate line, branch, and function coverage
- Generate coverage reports in various formats
The metadata is serialized to .ek9covmeta.json for use by the coverage reporter after test execution.
-
Constructor Summary
ConstructorsConstructorDescriptionCoverageModuleDetails(long moduleId, String moduleName, long sourceHash, int probeCount, List<CoverageProbeDetails> probes, List<CoverageFunctionDetails> functions) Creates an instance of aCoverageModuleDetailsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intGet the total number of functions in this module.Returns the value of thefunctionsrecord component.getFunction(int functionId) Get a function by its ID.getProbe(int probeId) Get a probe by its ID.final inthashCode()Returns a hash code value for this object.booleanCheck if this module has any coverage probes.longmoduleId()Returns the value of themoduleIdrecord component.Returns the value of themoduleNamerecord component.static CoverageModuleDetailsof(long moduleId, String moduleName, long sourceHash, List<CoverageProbeDetails> probes, List<CoverageFunctionDetails> functions) Create module details with computed probe count.intReturns the value of theprobeCountrecord component.probes()Returns the value of theprobesrecord component.longReturns the value of thesourceHashrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
CoverageModuleDetails
public CoverageModuleDetails(long moduleId, String moduleName, long sourceHash, int probeCount, List<CoverageProbeDetails> probes, List<CoverageFunctionDetails> functions) Creates an instance of aCoverageModuleDetailsrecord class.- Parameters:
moduleId- the value for themoduleIdrecord componentmoduleName- the value for themoduleNamerecord componentsourceHash- the value for thesourceHashrecord componentprobeCount- the value for theprobeCountrecord componentprobes- the value for theprobesrecord componentfunctions- the value for thefunctionsrecord component
-
-
Method Details
-
of
public static CoverageModuleDetails of(long moduleId, String moduleName, long sourceHash, List<CoverageProbeDetails> probes, List<CoverageFunctionDetails> functions) Create module details with computed probe count. -
getProbe
Get a probe by its ID.- Parameters:
probeId- The probe ID to look up- Returns:
- The probe details or null if not found
-
getFunction
Get a function by its ID.- Parameters:
functionId- The function ID to look up- Returns:
- The function details or null if not found
-
hasProbes
public boolean hasProbes()Check if this module has any coverage probes. -
functionCount
public int functionCount()Get the total number of functions in this module. -
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. -
moduleId
-
moduleName
Returns the value of themoduleNamerecord component.- Returns:
- the value of the
moduleNamerecord component
-
sourceHash
public long sourceHash()Returns the value of thesourceHashrecord component.- Returns:
- the value of the
sourceHashrecord component
-
probeCount
public int probeCount()Returns the value of theprobeCountrecord component.- Returns:
- the value of the
probeCountrecord component
-
probes
-
functions
-