Record Class JSentinelNotification

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.accountlifecycle.JSentinelNotification
Record Components:
kind - notification category; non-null
subjectId - recipient subject; non-null
tenant - tenant scope; null becomes TenantId.DEFAULT
timestamp - emit instant; non-null
attributes - immutable kind-specific metadata; null becomes Map.of()

@ExperimentalJSentinelApi public record JSentinelNotification(JSentinelNotification.Kind kind, SubjectId subjectId, TenantId tenant, Instant timestamp, Map<String,String> attributes) extends Record
Adapter-neutral notification payload handed to a JSentinelNotificationSender.

Sealed by JSentinelNotification.Kind — each lifecycle service emits exactly one kind so a recipient (mail-provider adapter, SMS gateway, audit mirror) can dispatch with a single switch. The attributes() map carries kind-specific metadata that doesn't fit on the record (e.g. the plain reset-link URL, the email address being verified) — the framework places stable keys there and the sender is free to consume them by string.

Stable attribute keys (placed by the framework):

  • Constructor Details

  • Method Details

    • 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.
    • kind

      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • subjectId

      public SubjectId subjectId()
      Returns the value of the subjectId record component.
      Returns:
      the value of the subjectId record component
    • tenant

      public TenantId tenant()
      Returns the value of the tenant record component.
      Returns:
      the value of the tenant record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • attributes

      public Map<String,String> attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component