Record Class UserPhone
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.sms.UserPhone
- Record Components:
userId- identifier of the user.phone- the verified number.verifiedAt- instant at which the user proved to own the number.
The verified phone number of a user.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PhoneNumberThe field for thephonerecord component.private final UUIDThe field for theuserIdrecord component.private final InstantThe field for theverifiedAtrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionUserPhone(UUID userId, PhoneNumber phone, Instant verifiedAt) Validates the phone. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.phone()Returns the value of thephonerecord component.final StringtoString()Returns a string representation of this record class.userId()Returns the value of theuserIdrecord component.Returns the value of theverifiedAtrecord component.
-
Field Details
-
userId
The field for theuserIdrecord component. -
phone
The field for thephonerecord component. -
verifiedAt
The field for theverifiedAtrecord component.
-
-
Constructor Details
-
UserPhone
Validates the phone.- Throws:
IllegalArgumentException- if any value is missing.
-
-
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). -
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
phone
Returns the value of thephonerecord component.- Returns:
- the value of the
phonerecord component
-
verifiedAt
Returns the value of theverifiedAtrecord component.- Returns:
- the value of the
verifiedAtrecord component
-