Record Class AuditQuery

java.lang.Object
java.lang.Record
com.tnsai.accountability.AuditQuery
Record Components:
agentId - filter to records produced by this identity; empty = any agent
liabilityAtLeast - records at this LiabilityClass or higher are returned; empty = any class
from - inclusive lower wall-clock bound; empty = no lower bound
to - exclusive upper wall-clock bound; empty = no upper bound
correlationId - exact-match correlation id; empty = any
limit - maximum records to return; non-positive = no cap

public record AuditQuery(Optional<String> agentId, Optional<LiabilityClass> liabilityAtLeast, Optional<Instant> from, Optional<Instant> to, Optional<String> correlationId, int limit) extends Record
Selection criteria for LiabilitySink.query(com.tnsai.accountability.AuditQuery) (TNS-298). Optional fields narrow the result set; null fields don't filter.

Querying is intentionally simple — adapters target relational / append-only stores where the framework can't push complex predicates portably. Operators who need richer querying read records out of the sink and filter in their own pipeline.

Since:
0.10.0 (TNS-298)
  • Constructor Details

  • Method Details

    • all

      public static AuditQuery all()
      No filters, no cap — match everything.
    • builder

      public static AuditQuery.Builder builder()
    • matches

      public boolean matches(AgentLiabilityRecord rec)
      Returns:
      true when rec matches every populated filter field. In-memory sinks use this to filter their backing collection; durable sinks may translate fields to native predicates and ignore this method.
    • 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 '=='.
      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.
    • agentId

      public Optional<String> agentId()
      Returns the value of the agentId record component.
      Returns:
      the value of the agentId record component
    • liabilityAtLeast

      public Optional<LiabilityClass> liabilityAtLeast()
      Returns the value of the liabilityAtLeast record component.
      Returns:
      the value of the liabilityAtLeast record component
    • from

      public Optional<Instant> from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • to

      public Optional<Instant> to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • correlationId

      public Optional<String> correlationId()
      Returns the value of the correlationId record component.
      Returns:
      the value of the correlationId record component
    • limit

      public int limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component