public final class PhoneNumber extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
format(String phoneNumber)
Format the phone number using the format for the default country.
|
static String |
format(String phoneNumber,
Country country)
Format the phone number using the National format specification defined for
the Country.
|
static String |
format(String phoneNumber,
Country country,
boolean international)
Format the phone number using the specification defined for the Country.
|
static String |
format(String phoneNumber,
Locale locale)
Format the phone number using the National format specification defined for
the Locale.
|
static String |
format(String phoneNumber,
String regex,
String format)
Parse a phone number using the regular expression and if it matches the
phone number, format it using the specified format otherwise return null.
|
static boolean |
isValid(String phoneNumber) |
static String |
normalize(String phoneNumber)
Normalize the phone number removing any non-digit characters.
|
public static String format(String phoneNumber)
phoneNumber - The normalized phone number to format.public static String format(String phoneNumber, Country country)
phoneNumber - The normalized phone number to format.country - The Country the phone number should be formatted for.public static String format(String phoneNumber, Country country, boolean international)
phoneNumber - The normalized phone number to format.country - The Country the phone number should be formatted for.international - True if the phone number should use the international
format.public static String format(String phoneNumber, Locale locale)
phoneNumber - The normalized phone number to format.locale - The Locale the phone number should be formatted for.public static String format(String phoneNumber, String regex, String format)
phoneNumber - The normalized phone number to format.regex - The regular expression to match phone numbers.format - The format specification.public static boolean isValid(String phoneNumber)
Copyright © 2015 Revolution Systems Inc.. All rights reserved.