public class E164PhoneNumberWithExtension extends Object implements PhoneNumber, Serializable
Modifier | Constructor and Description |
---|---|
|
E164PhoneNumberWithExtension(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber prototype)
Creates a instance from the given PhoneNumber
|
protected |
E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension)
Creates a new E164 Phone Number with the given extension.
|
protected |
E164PhoneNumberWithExtension(String phoneNumber,
CountryCode defaultCountryCode)
Creates a new E164 Phone Number.
|
protected |
E164PhoneNumberWithExtension(String e164PhoneNumber,
String extension)
Creates a new E164 Phone Number with the given extension.
|
protected |
E164PhoneNumberWithExtension(String phoneNumber,
String extension,
CountryCode defaultCountryCode)
Creates a new E164 Phone Number with the given extension.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
extractAreaCode()
Splits the national number into its constituent parts, returning that part of the number that
represents the area code.
|
ISOCountryCode |
extractCountryCode()
Returns the CountryCode this number belongs to
|
String |
extractSubscriberNumber()
Splits the national number into its constituent parts, returning that part of the number that
represents the subscriber number.
|
String |
getCountryDiallingCode()
Returns the dialling code for the country that this phone number belongs to.
|
String |
getExtension()
Returns the extension for the phone number or null.
|
String |
getNationalNumber()
Returns the national number part for the phone number.
|
com.google.i18n.phonenumbers.Phonenumber.PhoneNumber |
getUnderlyingPhoneNumber()
Returns the underlying LibPhoneNumber
Phonenumber.PhoneNumber instance. |
int |
hashCode() |
static E164PhoneNumberWithExtension |
ofE164PhoneNumberString(String e164PhoneNumber)
Creates a new E164 Phone Number.
|
static E164PhoneNumberWithExtension |
ofE164PhoneNumberStringAndExtension(String e164PhoneNumber,
String extension)
Creates a new E164 Phone Number with the given extension.
|
static E164PhoneNumberWithExtension |
ofE164PhoneNumberWithExtensionString(String e164PhoneNumber)
Creates a new E164 Phone Number with the given extension.
|
static E164PhoneNumberWithExtension |
ofPhoneNumberString(String phoneNumber,
CountryCode defaultCountryCode)
Creates a new E164 Phone Number.
|
static E164PhoneNumberWithExtension |
ofPhoneNumberStringAndExtension(String phoneNumber,
String extension,
CountryCode defaultCountryCode)
Creates a new E164 Phone Number with the given extension.
|
String |
toE164NumberString()
Returns the E164 formatted telephone number.
|
String |
toE164NumberWithExtensionString()
Returns the E164 formatted telephone number.
|
String |
toString() |
public E164PhoneNumberWithExtension(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber prototype)
prototype
- The PhoneNumber to construct the instance fromprotected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension)
e164PhoneNumberWithExtension
- The phone number in E164 format. The extension may be appended.
Any extension is appended to the number with the extension prefix given as ';ext='protected E164PhoneNumberWithExtension(String e164PhoneNumber, String extension)
e164PhoneNumber
- The phone number in E164 formatextension
- The extension, or null for no extensionprotected E164PhoneNumberWithExtension(String phoneNumber, CountryCode defaultCountryCode)
phoneNumber
- The phone number in arbitrary parseable format (may be a national format)defaultCountryCode
- The Country to apply if no country is indicated by the phone numberprotected E164PhoneNumberWithExtension(String phoneNumber, String extension, CountryCode defaultCountryCode)
phoneNumber
- The phone number in arbitrary parseable format (may be a national format)extension
- The extension, or null for no extensiondefaultCountryCode
- The Country to apply if no country is indicated by the phone numberpublic static E164PhoneNumberWithExtension ofE164PhoneNumberString(String e164PhoneNumber)
e164PhoneNumber
- The phone number in E164 format.public static E164PhoneNumberWithExtension ofE164PhoneNumberWithExtensionString(String e164PhoneNumber)
e164PhoneNumber
- The phone number in E164 format. The extension may be appended.
Any extension is appended to the number with the extension prefix given as ';ext='public static E164PhoneNumberWithExtension ofE164PhoneNumberStringAndExtension(String e164PhoneNumber, String extension)
e164PhoneNumber
- The phone number in E164 formatextension
- The extension, or null for no extensionpublic static E164PhoneNumberWithExtension ofPhoneNumberString(String phoneNumber, CountryCode defaultCountryCode)
phoneNumber
- The phone number in arbitrary parseable format (may be a national format)defaultCountryCode
- The Country to apply if no country is indicated by the phone numberpublic static E164PhoneNumberWithExtension ofPhoneNumberStringAndExtension(String phoneNumber, String extension, CountryCode defaultCountryCode)
phoneNumber
- The phone number in arbitrary parseable format (may be a national format)extension
- The extension, or null for no extensiondefaultCountryCode
- The Country to apply if no country is indicated by the phone numberpublic com.google.i18n.phonenumbers.Phonenumber.PhoneNumber getUnderlyingPhoneNumber()
Phonenumber.PhoneNumber
instance.
To preserve the immutability of E164PhoneNumber, a copy is made.public ISOCountryCode extractCountryCode()
extractCountryCode
in interface PhoneNumber
public String getCountryDiallingCode()
getCountryDiallingCode
in interface PhoneNumber
public String getNationalNumber()
getNationalNumber
in interface PhoneNumber
public String getExtension()
getExtension
in interface PhoneNumber
public String toE164NumberString()
toE164NumberString
in interface PhoneNumber
public String toE164NumberWithExtensionString()
toE164NumberWithExtensionString
in interface PhoneNumber
public String extractAreaCode()
extractAreaCode
in interface PhoneNumber
public String extractSubscriberNumber()
extractSubscriberNumber
in interface PhoneNumber
Copyright © 2010–2018 Jadira Systems. All rights reserved.