Record Class ProbeData

java.lang.Object
java.lang.Record
org.ek9lang.cli.coverage.model.ProbeData
Record Components:
sourceFile - The relative path to the source file
module - The EK9 module name
line - The line number where this probe is located
covered - Whether this probe was hit during test execution
probeType - The type of probe (METHOD, BRANCH, STATEMENT)
branchType - For branch probes, the specific branch type (BRANCH_TRUE, etc.), null otherwise

public record ProbeData(String sourceFile, String module, int line, boolean covered, String probeType, String branchType) extends Record
Immutable data carrier for coverage probe information. Decouples probe processing from CoverageRuntime API, enabling generic processing of all probe types through a single Consumer.
  • Constructor Details

    • ProbeData

      public ProbeData(String sourceFile, String module, int line, boolean covered, String probeType, String branchType)
      Creates an instance of a ProbeData record class.
      Parameters:
      sourceFile - the value for the sourceFile record component
      module - the value for the module record component
      line - the value for the line record component
      covered - the value for the covered record component
      probeType - the value for the probeType record component
      branchType - the value for the branchType record component
  • Method Details

    • isMethod

      public boolean isMethod()
      Check if this is a method entry probe.
    • isBranch

      public boolean isBranch()
      Check if this is a branch probe.
    • isStatement

      public boolean isStatement()
      Check if this is a statement probe.
    • 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.
    • sourceFile

      public String sourceFile()
      Returns the value of the sourceFile record component.
      Returns:
      the value of the sourceFile record component
    • module

      public String module()
      Returns the value of the module record component.
      Returns:
      the value of the module record component
    • line

      public int line()
      Returns the value of the line record component.
      Returns:
      the value of the line record component
    • covered

      public boolean covered()
      Returns the value of the covered record component.
      Returns:
      the value of the covered record component
    • probeType

      public String probeType()
      Returns the value of the probeType record component.
      Returns:
      the value of the probeType record component
    • branchType

      public String branchType()
      Returns the value of the branchType record component.
      Returns:
      the value of the branchType record component