Record Class AuditEnvelope
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.audit.AuditEnvelope
- Record Components:
id- non-blank store-assigned identifiertenant- tenant scope of the event;nullbecomesTenantId.DEFAULTevent- the wrapped audit event; nevernull
@ExperimentalJSentinelApi
public record AuditEnvelope(String id, TenantId tenant, AuditEvent event)
extends Record
Persisted form of an
AuditEvent. Pairs the event with a
store-assigned identifier and the tenant scope so a queryable audit
store can return events that survived past one in-process buffer.
The id is opaque to the framework: implementations of
AuditEventStore are free to use UUIDs, monotonic counters,
or any other stable identifier — the only contract is that
id uniquely identifies the envelope within the store.
-
Constructor Summary
ConstructorsConstructorDescriptionAuditEnvelope(String id, TenantId tenant, AuditEvent event) Validates the record components and substitutesTenantId.DEFAULTfor anulltenant. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.event()Returns the value of theeventrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.tenant()Returns the value of thetenantrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AuditEnvelope
Validates the record components and substitutesTenantId.DEFAULTfor anulltenant.- Parameters:
id- non-blank store-assigned identifiertenant- tenant scope;nullbecomesTenantId.DEFAULTevent- non-null audit event
-
-
Method Details
-
toString
-
hashCode
-
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). -
id
-
tenant
-
event
-