Record Class JSentinelNotification
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.accountlifecycle.JSentinelNotification
- Record Components:
kind- notification category; non-nullsubjectId- recipient subject; non-nulltenant- tenant scope;nullbecomesTenantId.DEFAULTtimestamp- emit instant; non-nullattributes- immutable kind-specific metadata; null becomesMap.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):
"tokenPlain"— the plain token value (never the hash) forJSentinelNotification.Kind.PASSWORD_RESET_REQUESTEDandJSentinelNotification.Kind.EMAIL_VERIFICATION_REQUESTED."email"— the email address being verified forJSentinelNotification.Kind.EMAIL_VERIFICATION_REQUESTEDandJSentinelNotification.Kind.EMAIL_VERIFIED."expiresAt"— ISO-8601 string forREQUESTEDkinds.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumNotification category — one per lifecycle hook. -
Constructor Summary
ConstructorsConstructorDescriptionJSentinelNotification(JSentinelNotification.Kind kind, SubjectId subjectId, TenantId tenant, Instant timestamp, Map<String, String> attributes) Validates the record components and freezes the attribute map. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.Returns the value of thesubjectIdrecord component.tenant()Returns the value of thetenantrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JSentinelNotification
-
-
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). -
kind
-
subjectId
-
tenant
-
timestamp
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-