Record Class PhoneNumber
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.sms.PhoneNumber
- Record Components:
e164- the number: a plus sign, then 7 to 15 digits, the first of which is not zero.
A phone number in E.164 format. Only the shape is validated here; turning user input into E.164 is the job of a
PhoneNormalizer.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptione164()Returns the value of thee164record component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
e164
The field for thee164record component. -
E164
Shape of an E.164 number.
-
-
Constructor Details
-
PhoneNumber
Validates the number.- Throws:
IllegalArgumentException- if the value is missing or not in E.164 shape.
-
-
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). -
e164
Returns the value of thee164record component.- Returns:
- the value of the
e164record component
-