Record Class ModuleInfo

java.lang.Object
java.lang.Record
org.ek9lang.cli.coverage.model.ModuleInfo
Record Components:
name - The module name (e.g., "my.module")
moduleId - The unique identifier for this module from CoverageRuntime
coverage - The overall coverage percentage for this module
hits - Number of probes that were hit during tests
total - Total number of probes in this module
files - List of source files belonging to this module

public record ModuleInfo(String name, long moduleId, double coverage, int hits, int total, List<SourceFileInfo> files) extends Record
Module information for grouping and display in coverage reports. Aggregates coverage data for all source files belonging to a module.
  • Constructor Details

    • ModuleInfo

      public ModuleInfo(String name, long moduleId, double coverage, int hits, int total, List<SourceFileInfo> files)
      Creates an instance of a ModuleInfo record class.
      Parameters:
      name - the value for the name record component
      moduleId - the value for the moduleId record component
      coverage - the value for the coverage record component
      hits - the value for the hits record component
      total - the value for the total record component
      files - the value for the files record component
  • Method Details

    • meetsThreshold

      public boolean meetsThreshold(double threshold)
      Check if this module meets the coverage threshold.
      Parameters:
      threshold - The coverage percentage threshold (e.g., 80.0)
      Returns:
      true if coverage meets or exceeds threshold
    • isFullyCovered

      public boolean isFullyCovered()
      Check if this module has full coverage.
      Returns:
      true if all probes were hit
    • uncoveredCount

      public int uncoveredCount()
      Get the number of uncovered probes.
      Returns:
      Number of probes not hit
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • moduleId

      public long moduleId()
      Returns the value of the moduleId record component.
      Returns:
      the value of the moduleId record component
    • coverage

      public double coverage()
      Returns the value of the coverage record component.
      Returns:
      the value of the coverage record component
    • hits

      public int hits()
      Returns the value of the hits record component.
      Returns:
      the value of the hits record component
    • total

      public int total()
      Returns the value of the total record component.
      Returns:
      the value of the total record component
    • files

      public List<SourceFileInfo> files()
      Returns the value of the files record component.
      Returns:
      the value of the files record component