Package com.google.i18n.phonenumbers
Enum Class PhoneNumberUtil.PhoneNumberFormat
java.lang.Object
java.lang.Enum<PhoneNumberUtil.PhoneNumberFormat>
com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat
- All Implemented Interfaces:
Serializable
,Comparable<PhoneNumberUtil.PhoneNumberFormat>
,java.lang.constant.Constable
- Enclosing class:
- PhoneNumberUtil
public static enum PhoneNumberUtil.PhoneNumberFormat
extends Enum<PhoneNumberUtil.PhoneNumberFormat>
INTERNATIONAL and NATIONAL formats are consistent with the definition in ITU-T Recommendation
E.123. However we follow local conventions such as using '-' instead of whitespace as
separators. For example, the number of the Google Switzerland office will be written as
"+41 44 668 1800" in INTERNATIONAL format, and as "044 668 1800" in NATIONAL format. E164
format is as per INTERNATIONAL format but with no formatting applied, e.g. "+41446681800".
RFC3966 is as per INTERNATIONAL format, but with all spaces and other separating symbols
replaced with a hyphen, and with any phone number extension appended with ";ext=". It also
will have a prefix of "tel:" added, e.g. "tel:+41-44-668-1800".
Note: If you are considering storing the number in a neutral format, you are highly advised to
use the PhoneNumber class.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static PhoneNumberUtil.PhoneNumberFormat[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
E164
-
INTERNATIONAL
-
NATIONAL
-
RFC3966
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-