Class TimestampDetector

Namespace
Kuestenlogik.Bowire.Semantics.Detectors
Assembly
Kuestenlogik.Bowire.dll

Detects fields that carry timestamps — either an ISO-8601 string parsed via TryParse(string, IFormatProvider, DateTimeStyles, out DateTimeOffset) with RoundtripKind, or a numeric epoch (seconds or milliseconds since 1970) within ±20 years of "now".

public sealed class TimestampDetector : IBowireFieldDetector
Inheritance
TimestampDetector
Implements
Inherited Members

Remarks

Name pattern is required (the value-shape alone is not enough — "42" looks like an epoch second, but at 42 seconds past the Unix epoch it's almost certainly a duration in disguise). Name matches:

  • contains timestamp (case-insensitive),
  • contains time (case-insensitive),
  • ends in at (case-insensitive) — createdAt, updatedAt.

Epoch plausibility window: ±20 years around UtcNow. Wide enough to cover most application data; narrow enough to reject random small integers (counters, sequence numbers, pixel coordinates) that share the name pattern.

Constructors

TimestampDetector()

Default constructor — uses System. Public so the DI container can wire it up without registering the time provider itself.

public TimestampDetector()

TimestampDetector(TimeProvider)

Test-seam constructor — accepts a custom TimeProvider so the epoch-plausibility window is pinned to a known "now" in unit tests.

public TimestampDetector(TimeProvider timeProvider)

Parameters

timeProvider TimeProvider

Properties

Id

Stable id used by logging + the future "registered detectors" surface. Conventionally a dotted namespace (kuestenlogik.wgs84-coordinate); not required to be a URI.

public string Id { get; }

Property Value

string

Methods

Detect(in DetectionContext)

public IEnumerable<DetectionResult> Detect(in DetectionContext ctx)

Parameters

ctx DetectionContext

Returns

IEnumerable<DetectionResult>