Package org.egothor.methodatlas
Record Class ScanRun
java.lang.Object
java.lang.Record
org.egothor.methodatlas.ScanRun
- Record Components:
runId- short hex correlation id, non-emptystartedAt- wall-clock time the run was startedtoolVersion- implementation version or"dev"configFingerprint- SHA-256 hex digest of the canonical configuration text; nevernull, never empty
public record ScanRun(String runId, Instant startedAt, String toolVersion, String configFingerprint)
extends Record
Immutable record identifying one CLI invocation of MethodAtlas.
Created once at the top of MethodAtlasApp.run(String[], java.io.PrintWriter)
and propagated through ScanRunContext so that every log record
emitted during the run can carry the correlation id. This makes it
possible to trace a single audit-trail artefact, a single SARIF file, or a
single CI log slice back to the exact run that produced it.
Fields
runId— a short hex-encoded random id (16 hex characters); intentionally not a full UUID because the id appears in log lines and CSV preamble where 36-character UUIDs are noisy.startedAt— wall-clock timestamp at run construction.toolVersion— implementation version reported by themethodatlasJAR manifest; falls back to"dev"for developer builds.configFingerprint— SHA-256 of a stable textual rendering of the parsedCliConfig. Lets two runs of the same configuration be correlated across time and machine boundaries.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfigFingerprintrecord component.static ScanRunCreates a newScanRunwith a freshly generated correlation id and the current wall-clock timestamp.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.runId()Returns the value of therunIdrecord component.Returns the value of thestartedAtrecord component.Returns the value of thetoolVersionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ScanRun
Compact constructor enforcing the documented invariants on the component values.
-
-
Method Details
-
create
Creates a newScanRunwith a freshly generated correlation id and the current wall-clock timestamp.The
configFingerprintis the SHA-256 ofconfigText, a stable textual rendering of the parsed CLI configuration. Two runs with byte-identical configuration produce the same fingerprint, letting operators correlate scans without sharing the full config.- Parameters:
toolVersion- implementation version, or"dev"for builds without a manifest versionconfigText- canonical textual rendering of the parsedCliConfig; must not benull- Returns:
- a fresh scan-run identifier
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
runId
Returns the value of therunIdrecord component.- Returns:
- the value of the
runIdrecord component
-
startedAt
Returns the value of thestartedAtrecord component.- Returns:
- the value of the
startedAtrecord component
-
toolVersion
Returns the value of thetoolVersionrecord component.- Returns:
- the value of the
toolVersionrecord component
-
configFingerprint
Returns the value of theconfigFingerprintrecord component.- Returns:
- the value of the
configFingerprintrecord component
-