public class PhoneNumber extends java.lang.Object implements ContactMethod
| Constructor and Description |
|---|
PhoneNumber(java.lang.String phoneNumber)
Constructor by Phone number.
|
PhoneNumber(java.lang.String phoneNumber,
boolean verified)
Constructor by Phone number and Verified value.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAreaCode()
Getter for the 3 digits Area Code of the Phone Number.
|
java.lang.String |
getFormatted()
Returns the Phone Number in format (123) 456-7890.
|
java.lang.String |
getMasked()
Returns the Phone Number in masked format (***) ***-7890.
|
java.lang.String |
getType()
Getter for the class type.
|
java.lang.String |
getValue()
Returns the Phone Number value.
|
boolean |
isEmpty()
Indicates if the Phone Number is empty.
|
boolean |
isValid()
Match the pattern for a 10 digits Phone Number.
|
boolean |
isVerified()
Indicates if the Phone Number is verified.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisEmptypublic PhoneNumber(java.lang.String phoneNumber)
Will validate if the provided Phone Number is not Empty, if so, it will remove all characters except numbers from it (Cleansing).
phoneNumber - The Phone Number.public PhoneNumber(java.lang.String phoneNumber,
boolean verified)
Will validate if the provided Phone Number is not Empty, if so, it will remove all characters except numbers from it (Cleansing).
phoneNumber - The Phone Number.verified - Indicates if the Phone Number is Verified.public java.lang.String getFormatted()
getFormatted in interface ContactMethodpublic java.lang.String getMasked()
getMasked in interface ContactMethodpublic java.lang.String getValue()
getValue in interface ContactMethodpublic boolean isVerified()
isVerified in interface ContactMethodpublic boolean isEmpty()
isEmpty in interface ContactMethodpublic boolean isValid()
isValid in interface ContactMethodpublic java.lang.String getType()
getType in interface ContactMethodpublic java.lang.String getAreaCode()
public java.lang.String toString()
toString in class java.lang.Object