Record Class DiagnosticSnapshot

java.lang.Object
java.lang.Record
ca.mcscert.jpipe.compiler.model.DiagnosticSnapshot
Record Components:
source - path of the compiled source file.
diagnostics - all diagnostics reported during compilation, in report order.
stats - named compilation statistics in insertion order; empty when the interpretation step did not run.
models - one entry per model in the unit, in declaration order.
actions - the ordered list of executed actions; empty when not recorded.

public record DiagnosticSnapshot(String source, List<Diagnostic> diagnostics, Map<String,Long> stats, List<DiagnosticSnapshot.ModelInfo> models, List<DiagnosticSnapshot.ActionInfo> actions) extends Record
An immutable, render-agnostic view of everything a diagnostic report shows.

Produced once by ca.mcscert.jpipe.compiler.steps.transformations.CollectDiagnostics from a compiled Unit and its CompilationContext, then consumed by every report renderer. Holding the collection step in common is what keeps the human-readable and JSON reports from drifting apart: a section added here surfaces in both, and neither renderer walks the model itself.

This record carries data only — no formatting. Presentation choices (bracketing codes, padding columns, eliding unknown locations) belong to the renderers.

  • Field Details

    • KIND_JUSTIFICATION

      public static final String KIND_JUSTIFICATION
      Model kind discriminator: a concrete justification.
      See Also:
    • KIND_TEMPLATE

      public static final String KIND_TEMPLATE
      Model kind discriminator: a reusable template.
      See Also:
  • Constructor Details

  • Method Details

    • hasErrors

      public boolean hasErrors()
      True if any ERROR or FATAL diagnostic was reported.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • source

      public String source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • diagnostics

      public List<Diagnostic> diagnostics()
      Returns the value of the diagnostics record component.
      Returns:
      the value of the diagnostics record component
    • stats

      public Map<String,Long> stats()
      Returns the value of the stats record component.
      Returns:
      the value of the stats record component
    • models

      Returns the value of the models record component.
      Returns:
      the value of the models record component
    • actions

      Returns the value of the actions record component.
      Returns:
      the value of the actions record component