Record Class FederatedIdentity
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.social.FederatedIdentity
- Record Components:
id- identifier of the link.userId- identifier of the local account (theusersrow).provider- provider that holds the identity.subject- stable identifier the provider assigned to the user (thesubclaim, or the numeric id of GitHub).email- e-mail address the provider reported when the identity was last used, ornull.linkedAt- instant at which the identity was linked.lastLoginAt- instant of the last sign-in with it, ornullwhen it has not been used since it was linked.
public record FederatedIdentity(UUID id, UUID userId, IdentityProvider provider, String subject, String email, Instant linkedAt, Instant lastLoginAt)
extends Record
An identity of an external provider linked to a local account: the account is reached by presenting the provider's
stable subject, never by its e-mail address, which a provider may change.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theemailrecord component.private final UUIDThe field for theidrecord component.private final InstantThe field for thelastLoginAtrecord component.private final InstantThe field for thelinkedAtrecord component.private final IdentityProviderThe field for theproviderrecord component.private final StringThe field for thesubjectrecord component.private final UUIDThe field for theuserIdrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionFederatedIdentity(UUID id, UUID userId, IdentityProvider provider, String subject, String email, Instant linkedAt, Instant lastLoginAt) Validates the identity. -
Method Summary
Modifier and TypeMethodDescriptionemail()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of thelastLoginAtrecord component.linkedAt()Returns the value of thelinkedAtrecord component.provider()Returns the value of theproviderrecord component.subject()Returns the value of thesubjectrecord component.final StringtoString()Returns a string representation of this record class.userId()Returns the value of theuserIdrecord component.
-
Field Details
-
id
The field for theidrecord component. -
userId
The field for theuserIdrecord component. -
provider
The field for theproviderrecord component. -
subject
The field for thesubjectrecord component. -
email
The field for theemailrecord component. -
linkedAt
The field for thelinkedAtrecord component. -
lastLoginAt
The field for thelastLoginAtrecord component.
-
-
Constructor Details
-
FederatedIdentity
public FederatedIdentity(UUID id, UUID userId, IdentityProvider provider, String subject, String email, Instant linkedAt, Instant lastLoginAt) Validates the identity.- Throws:
IllegalArgumentException- if the id, the account, the provider or the link instant is missing, the subject is blank, or the e-mail address is present and blank.
-
-
Method Details
-
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. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
provider
Returns the value of theproviderrecord component.- Returns:
- the value of the
providerrecord component
-
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-
linkedAt
Returns the value of thelinkedAtrecord component.- Returns:
- the value of the
linkedAtrecord component
-
lastLoginAt
Returns the value of thelastLoginAtrecord component.- Returns:
- the value of the
lastLoginAtrecord component
-