public class PhoneNumberHelper
extends java.lang.Object
| Constructor and Description |
|---|
PhoneNumberHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
format(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber,
boolean internationalFormat)
Formats the given number, either in national or international format, according to the given flag.
|
static java.lang.String |
format(java.lang.String number,
java.lang.String countryCode,
boolean internationalFormat)
Formats the given number, either in national or international format, according to the given flag.
|
static java.lang.String |
formatNormalized(java.lang.String normalizedNumber,
ConfigurationAccessor configuration)
Formats the given normalized number, either in national or international format,
depending on whether the viewer's configuration forces international number and on its country.
|
static java.lang.String |
getExampleNumber(PhoneNature nature,
java.lang.String countryCode,
boolean internationalFormat)
Returns a formatted phone number which serves as example for the given number type.
|
static boolean |
matchesNature(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber,
PhoneNature expectedNature)
Returns whether the given phone number matches an expected phone nature in Cyclos
|
static java.lang.String |
normalize(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber)
Formats a phone number to the E164 standard format, returning null on invalid phones
|
static java.lang.String |
normalize(java.lang.String rawNumber,
java.lang.String countryCode)
Formats a raw phone number, on a given country, to the E164 standard format, returning null if the number is
invalid.
|
static com.google.i18n.phonenumbers.Phonenumber.PhoneNumber |
parse(java.lang.String rawNumber,
java.lang.String countryCode)
Parses a number defaulting to the given country code
|
public static java.lang.String format(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber,
boolean internationalFormat)
public static java.lang.String format(java.lang.String number,
java.lang.String countryCode,
boolean internationalFormat)
public static java.lang.String formatNormalized(java.lang.String normalizedNumber,
ConfigurationAccessor configuration)
public static java.lang.String getExampleNumber(PhoneNature nature, java.lang.String countryCode, boolean internationalFormat)
public static boolean matchesNature(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber,
PhoneNature expectedNature)
public static java.lang.String normalize(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber)
public static java.lang.String normalize(java.lang.String rawNumber,
java.lang.String countryCode)
public static com.google.i18n.phonenumbers.Phonenumber.PhoneNumber parse(java.lang.String rawNumber,
java.lang.String countryCode)
throws com.google.i18n.phonenumbers.NumberParseException
com.google.i18n.phonenumbers.NumberParseException