Record Class EmailCodeRequested
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.application.ott.EmailCodeRequested
- Record Components:
address- the verified e-mail address.code- the code in clear text.validFor- how long the code stays valid, shown to the user.
Event published when a one-time code must be e-mailed. It is delivered once the transaction that stored the code
commits, outside of it and off the request thread, so the mail server's latency neither holds a database connection
nor shows in the response (which would tell an existing account from an unknown one).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEmailCodeRequested(String address, String code, Duration validFor) Validates the event. -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.code()Returns the value of thecoderecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.toString()Describes the event without the address and the code, so neither ever reaches a log.validFor()Returns the value of thevalidForrecord component.
-
Field Details
-
Constructor Details
-
EmailCodeRequested
Validates the event.- Throws:
IllegalArgumentException- if a value is missing or blank.
-
-
Method Details
-
toString
Describes the event without the address and the code, so neither ever reaches a log. -
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. -
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). -
address
Returns the value of theaddressrecord component.- Returns:
- the value of the
addressrecord component
-
code
Returns the value of thecoderecord component.- Returns:
- the value of the
coderecord component
-
validFor
Returns the value of thevalidForrecord component.- Returns:
- the value of the
validForrecord component
-