Class PhoneNumberIdentifier
- java.lang.Object
-
- com.azure.android.communication.common.CommunicationIdentifier
-
- com.azure.android.communication.common.PhoneNumberIdentifier
-
public final class PhoneNumberIdentifier extends CommunicationIdentifier
Communication identifier for Communication Services Phone Numbers
-
-
Constructor Summary
Constructors Constructor Description PhoneNumberIdentifier(java.lang.String phoneNumber)
Creates a PhoneNumberIdentifier object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object that)
java.lang.String
getAssertedId()
Gets the asserted ID for the phone number, distinguishing it from other connections made through the same number.java.lang.String
getPhoneNumber()
int
hashCode()
boolean
isAnonymous()
Checks if the phone number is anonymous, e.g., used to represent a hidden caller ID.PhoneNumberIdentifier
setRawId(java.lang.String rawId)
Set full id of the identifier RawId is the encoded format for identifiers to store in databases or as stable keys in general.-
Methods inherited from class com.azure.android.communication.common.CommunicationIdentifier
fromRawId, getRawId
-
-
-
-
Constructor Detail
-
PhoneNumberIdentifier
public PhoneNumberIdentifier(java.lang.String phoneNumber)
Creates a PhoneNumberIdentifier object- Parameters:
phoneNumber
- the string identifier representing the PhoneNumber in E.164 format. E.164 is a phone number formatted as +[CountryCode][AreaCode][LocalNumber] eg. "+18005555555"- Throws:
java.lang.IllegalArgumentException
- thrown if phoneNumber parameter fail the validation.
-
-
Method Detail
-
getPhoneNumber
public java.lang.String getPhoneNumber()
- Returns:
- the string identifier representing the object identity
-
isAnonymous
public boolean isAnonymous()
Checks if the phone number is anonymous, e.g., used to represent a hidden caller ID.- Returns:
- true if the phone number is anonymous, false otherwise.
-
getAssertedId
public java.lang.String getAssertedId()
Gets the asserted ID for the phone number, distinguishing it from other connections made through the same number.- Returns:
- the string identifier representing the asserted ID for the phone number.
-
setRawId
public PhoneNumberIdentifier setRawId(java.lang.String rawId)
Set full id of the identifier RawId is the encoded format for identifiers to store in databases or as stable keys in general.- Overrides:
setRawId
in classCommunicationIdentifier
- Parameters:
rawId
- full id of the identifier- Returns:
- PhoneNumberIdentifier object itself
-
equals
public boolean equals(java.lang.Object that)
- Overrides:
equals
in classCommunicationIdentifier
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCommunicationIdentifier
-
-