@ThreadSafe @Singleton public class CountryCache extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
CountryCache() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsCountry(Locale aCountry)
Check if the passed country is known.
|
boolean |
containsCountry(String sCountry)
Check if the passed country is known.
|
ICommonsSet<String> |
getAllCountries() |
ICommonsSet<Locale> |
getAllCountryLocales() |
Locale |
getCountry(Locale aCountry)
The normed country locale associated with the provided locale.
|
Locale |
getCountry(String sCountry)
Resolve the country from the provided string.
|
static CountryCache |
getInstance() |
static boolean |
isInstantiated() |
void |
reinitialize()
Reset the cache to the initial state.
|
public static boolean isInstantiated()
@Nonnull public static CountryCache getInstance()
null.@Nullable public Locale getCountry(@Nullable Locale aCountry)
aCountry - Source locale. May be null.null if the source locale is null or if
the source locale does not contain country information.@Nullable public Locale getCountry(@Nullable String sCountry)
sCountry - The country code. May be null or empty.null if the provided country code is null
or empty.@Nonnull @ReturnsMutableCopy public ICommonsSet<String> getAllCountries()
null.@Nonnull @ReturnsMutableCopy public ICommonsSet<Locale> getAllCountryLocales()
null.public boolean containsCountry(@Nullable Locale aCountry)
aCountry - The country to check. May be null.true if the passed country is contained,
false otherwise.public boolean containsCountry(@Nullable String sCountry)
sCountry - The country to check. May be null.true if the passed country is contained,
false otherwise.public final void reinitialize()
Copyright © 2014–2019 Philip Helger. All rights reserved.