Record Class InvitationMessage
java.lang.Object
java.lang.Record
org.jwcarman.who.emaillink.InvitationMessage
- Record Components:
address- the invited address, and the recipientlink- the sign-in link, carrying the token in its fragmentcode- the raw normalized sign-in codeexpiresAt- when the link and the code stop workingvalidFor- how long the link and the code work from when the email is sentroles- the names of the roles the invitation gave the identity; empty for none
- All Implemented Interfaces:
WhoEmail
public record InvitationMessage(String address, String link, String code, Instant expiresAt, Duration validFor, Set<String> roles)
extends Record
implements WhoEmail
An email inviting a person to the application: the link and the typed code that both sign them in
with the invited address, which is accepting the invitation. It is what
InvitationService
sends, so a sender can word an invitation differently from a sign-in.-
Constructor Summary
Constructors -
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.Returns the value of theexpiresAtrecord component.Returns how long the link and the code work, for reading:15 minutes,1 minute.Returns the code laid out for reading, for exampleK7F-2QM.final inthashCode()Returns a hash code value for this object.link()Returns the value of thelinkrecord component.roles()Returns the value of therolesrecord component.template()Returnsinvitation, the name of this email's template.toString()Returns a string representation of this record class.validFor()Returns the value of thevalidForrecord component.
-
Constructor Details
-
InvitationMessage
-
-
Method Details
-
toString
-
formattedCode
Returns the code laid out for reading, for exampleK7F-2QM.- Returns:
- the formatted code
-
expiresIn
Returns how long the link and the code work, for reading:15 minutes,1 minute.- Returns:
- the time left, in whole minutes rounded up
-
template
-
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). -
address
-
link
-
code
-
expiresAt
-
validFor
-
roles
-