public final class World extends Object
Modifier and Type | Class and Description |
---|---|
static class |
World.Continent
An Enum to hold the different continents
|
Modifier and Type | Method and Description |
---|---|
static List<Country> |
getAllCountries()
Get a list of all the countries with their flags
|
static List<Currency> |
getAllCurrencies()
Return all the currencies of the world
|
static List<Country> |
getCountriesFrom(World.Continent continent)
Get Countries from a continent
|
static Country |
getCountryFrom(int numericCode)
Get a country from its numeric code
|
static Country |
getCountryFrom(String countryIdentifier)
Get a country from any of its identifiers
|
static int |
getFlagOf(int countryCode)
Get the flag of a country using the numeric code of the country
|
static int |
getFlagOf(String countryIdentifier)
Get the flag of a country
|
static int |
getWorldFlag()
Get the image of the globe directly rather than querying World.getFlagOf("globe")
|
static void |
init(android.content.Context context)
Initialize the world, just as it is today with all its countries and flags
|
static String |
version()
Get the current version of the library
|
public static void init(android.content.Context context)
context
- The context where this object is called (getAppicationContext)public static int getFlagOf(int countryCode)
countryCode
- The numeric code of the countrypublic static int getFlagOf(String countryIdentifier)
countryIdentifier
- the 2 or 3 letter representation of the country
Note: If the values are correct and you still do not get the flag, create an issue and this will be resolved as soon as possible.
public static int getWorldFlag()
public static Country getCountryFrom(int numericCode)
numericCode
- The country's numeric codepublic static Country getCountryFrom(String countryIdentifier)
countryIdentifier
- The country name, alpha2 or alpha3 values, case insensitivepublic static List<Country> getAllCountries()
public static List<Currency> getAllCurrencies()
public static List<Country> getCountriesFrom(@Nullable World.Continent continent)
continent
- a World.Continent
If null is passed, then getAllCountries()
is returned
public static String version()