|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectesmska.data.CountryPrefix
public class CountryPrefix
Class containing list of all telephone country prefixes (as defined in List of country calling codes) and some helper methods.
Field Summary | |
---|---|
static java.lang.String |
INTERNATIONAL_CODE
Country code for "international" |
Constructor Summary | |
---|---|
CountryPrefix()
|
Method Summary | |
---|---|
static java.lang.String |
extractCountryCode(java.lang.String gatewayName)
Extract country code from gateway name |
static java.lang.String |
extractCountryPrefix(java.lang.String number)
Extract country prefix from phone number. |
static java.lang.String |
getCountryCode(java.lang.String countryPrefix)
Get country code for country with specified telephone country prefix. |
static java.util.ArrayList<java.lang.String> |
getCountryCodes()
Get all country codes sorted ascendingly |
static java.lang.String |
getCountryPrefix(java.lang.String countryCode)
Get telephone country prefix for country with country code. |
static boolean |
isValidCountryPrefix(java.lang.String prefix)
Check validity of country prefix |
static java.lang.String |
stripCountryPrefix(java.lang.String number,
boolean onlyCurrent)
Strip current country prefix from number if possible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String INTERNATIONAL_CODE
Constructor Detail |
---|
public CountryPrefix()
Method Detail |
---|
public static java.lang.String getCountryPrefix(java.lang.String countryCode)
countryCode
- two letter country code as defined in
ISO 3166-1 alpha-2.
public static java.lang.String getCountryCode(java.lang.String countryPrefix)
countryPrefix
- telephone country prefix as defined in
List of country calling codes.
May be null or invalid.
public static java.util.ArrayList<java.lang.String> getCountryCodes()
public static java.lang.String stripCountryPrefix(java.lang.String number, boolean onlyCurrent)
number
- number, can be nullonlyCurrent
- strip only currently set country prefix (in user
preferences), do not touch numbers with other prefixes
public static java.lang.String extractCountryPrefix(java.lang.String number)
number
- Phone number in fully international format. May be null or
incomplete.
public static boolean isValidCountryPrefix(java.lang.String prefix)
public static java.lang.String extractCountryCode(java.lang.String gatewayName)
gatewayName
- gateway name; may be invalid or null
gatewayName
invalid or null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |