Record Class ResetTokenRecord
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.reset.ResetTokenRecord
public record ResetTokenRecord(TokenDigestRecord digest, String username, Instant issuedAt, Instant expiresAt, ResetTokenStatus status, long version)
extends Record
Persisted password-reset token. Holds the selector, the digest of the
verifier (never the verifier itself), the owner's username, the
lifecycle status and the timestamps that drive single-use and expiry.
The version field is an optimistic-lock counter — bumped
on every status transition so the store can CAS without losing
concurrent updates (CWE-362).
-
Constructor Summary
ConstructorsConstructorDescriptionResetTokenRecord(TokenDigestRecord digest, String username, Instant issuedAt, Instant expiresAt, ResetTokenStatus status, long version) Creates an instance of aResetTokenRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondigest()Returns the value of thedigestrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresAtrecord component.final inthashCode()Returns a hash code value for this object.booleanissuedAt()Returns the value of theissuedAtrecord component.selector()status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.longversion()Returns the value of theversionrecord component.withStatus(ResetTokenStatus newStatus)
-
Constructor Details
-
ResetTokenRecord
public ResetTokenRecord(TokenDigestRecord digest, String username, Instant issuedAt, Instant expiresAt, ResetTokenStatus status, long version) Creates an instance of aResetTokenRecordrecord class.- Parameters:
digest- the value for thedigestrecord componentusername- the value for theusernamerecord componentissuedAt- the value for theissuedAtrecord componentexpiresAt- the value for theexpiresAtrecord componentstatus- the value for thestatusrecord componentversion- the value for theversionrecord component
-
-
Method Details
-
selector
-
isExpired
-
withStatus
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
digest
Returns the value of thedigestrecord component.- Returns:
- the value of the
digestrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
issuedAt
Returns the value of theissuedAtrecord component.- Returns:
- the value of the
issuedAtrecord component
-
expiresAt
Returns the value of theexpiresAtrecord component.- Returns:
- the value of the
expiresAtrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
version
public long version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-