Package com.storedobject.common
Class Country
java.lang.Object
com.storedobject.common.Country
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Check a given country code for its validity.static String
Check a given country code for its validity.static Country
Get country for a given short name.static Country
getByPhoneNumber
(String phoneNumber) Get the country for the given phone number by matching its ISD prefix.getFlag()
Get the flag as an emoji that can be displayed in most of the computer systems.Get the ISD prefix for the country.Get ISO 3 character code of the country.Get theLocale
s of the country.Get the local name of the country.getName()
Gets the name of the CountrygetNextByPhoneNumber
(String phoneNumber) Get the next country for the given phone number by matching its ISD prefix.Gets the short name of the Country.boolean
isRTL()
Is the default language of this country is RTL (right-to-left)?static boolean
Is the language of the given locale is RTL (right-to-left)?list()
Get the list of countries.Get the list of ISD prefixes for the country.toString()
-
Method Details
-
get
-
list
-
check
Check a given country code for its validity.- Parameters:
countryCode
- Country code to be checked- Returns:
- Country code (maybe modified).
- Throws:
SOException
- If the country is invalid
-
check
Check a given country code for its validity.- Parameters:
countryCode
- Country code to be checkedallowEmpty
- Whether empty should be taken as valid or not- Returns:
- Country code (may be modified).
- Throws:
SOException
- If the country is invalid
-
getName
-
getShortName
-
getLocales
-
isRTL
public boolean isRTL()Is the default language of this country is RTL (right-to-left)?- Returns:
- True or false.
-
isRTL
Is the language of the given locale is RTL (right-to-left)?- Parameters:
locale
- Locale.- Returns:
- True or false.
-
getISO3CharacterCode
Get ISO 3 character code of the country.- Returns:
- ISO 3 character code.
-
getLocalName
Get the local name of the country.- Returns:
- Country's name in local language.
-
getISDCode
Get the ISD prefix for the country.- Returns:
- ISD dialing prefix (will not contain leading "+" symbol).
-
listISDPrefix
Get the list of ISD prefixes for the country. Returns empty list for all countries except the following:Bonaire, Sint Eustatius and Saba (BQ), Canada (CA), Coco (Keeling) Islands (CC), Christmas Islands (CX). Dominican Republic (DO), Puerto Rico (PR), Svalbard & Jan Mayen (SJ),
Note: This is used in the case of regions sharing same prefix with other countries.
- Returns:
- List of ISD prefix strings.
-
getFlag
Get the flag as an emoji that can be displayed in most of the computer systems.- Returns:
- Flag emoji.
-
toString
-
getByPhoneNumber
-
getNextByPhoneNumber
-