com.elasticpath.domain.misc
Interface Geography

All Superinterfaces:
EpDomain, java.io.Serializable, Transient
All Known Implementing Classes:
GeographyImpl

public interface Geography
extends java.io.Serializable, Transient

Represents a set of countries and provides geography-related functionality such as finding the subcountries of a particular country. A subcountry is a region of a country such as a province, state, or territory. This class could be renamed "Geography".


Field Summary
static java.lang.String COUNTRY_PROPS
          Key for properties relating to countries (File name without the .properties extension).
static java.lang.String DEFAULT_COUNTRY
          Key to indicated that no country has been selected yet.
static java.lang.String SUBCOUNTRY_PROPS_KEY_PREFIX
          Prefix for constructing a key to retrieve a map of a country's subcounries.
 
Method Summary
 java.util.Map getAllSubCountries()
          Returns the default map of all subcountries codes and their labels.
 java.util.Map getAllSubCountries(java.util.Locale locale)
          Returns a localized map of all subcountries codes and their labels.
 java.util.Map getAvailableSubCountries()
          Return the available subcountries based on the specified list of available regions set using the setAvailableRegions method.
 java.util.Map getCountries()
          Returns the default map of countries where key = the country code and the value is the label for the country.
 java.util.Map getCountries(java.util.Locale locale)
          Returns a localize map of countries where key = the country code and the value is the label for the country.
 java.util.Map getCountry2SubCountries()
          Return the default map of countryCode to subcountries codes/labels mapping.
 java.util.Map getCountry2SubCountries(java.util.Locale locale)
          Return a localized map of countryCode to subcountries codes/labels mapping.
 java.util.Map getCountry2SubCountriesMap()
          Return the default map of countryCode to subcountries codes/labels mapping.
 java.util.Map getSubCountries(java.lang.String countryCode)
          Return the default map of subcountries codes and their labels for the country with the given ISO country code.
 java.util.Map getSubCountries(java.lang.String countryCode, java.util.Locale locale)
          Return a localized map of subcountries codes and their labels for the country with the given ISO country code.
 void setAvailableRegions(java.util.List regions)
          Set the ShippingRegions that define the set of available countries and subcountries.
 void setPropertiesMap(java.util.Map propertiesMap)
          Set the properties files that are used as a source of Country and SubCountry data.
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

COUNTRY_PROPS

static final java.lang.String COUNTRY_PROPS
Key for properties relating to countries (File name without the .properties extension).

See Also:
Constant Field Values

DEFAULT_COUNTRY

static final java.lang.String DEFAULT_COUNTRY
Key to indicated that no country has been selected yet.

See Also:
Constant Field Values

SUBCOUNTRY_PROPS_KEY_PREFIX

static final java.lang.String SUBCOUNTRY_PROPS_KEY_PREFIX
Prefix for constructing a key to retrieve a map of a country's subcounries.

See Also:
Constant Field Values
Method Detail

getAllSubCountries

java.util.Map getAllSubCountries()
Returns the default map of all subcountries codes and their labels. Subcountries are any region of a country such as a province, state, or territory. Note that this method assumes the country information does not change at runtime.

Returns:
a map of codes to labels of subcountries for all countries.

getAllSubCountries

java.util.Map getAllSubCountries(java.util.Locale locale)
Returns a localized map of all subcountries codes and their labels. Subcountries are any region of a country such as a province, state, or territory. Note that this method assumes the country information does not change at runtime.

Parameters:
locale - the current locale
Returns:
a map of codes to labels of subcountries for all countries.

getAvailableSubCountries

java.util.Map getAvailableSubCountries()
Return the available subcountries based on the specified list of available regions set using the setAvailableRegions method.

Returns:
a Map of subcountry codes to subcountry display names

getCountries

java.util.Map getCountries()
Returns the default map of countries where key = the country code and the value is the label for the country.

Returns:
the map of country values and labels

getCountries

java.util.Map getCountries(java.util.Locale locale)
Returns a localize map of countries where key = the country code and the value is the label for the country.

Parameters:
locale - the current locale
Returns:
the map of country values and labels

getCountry2SubCountries

java.util.Map getCountry2SubCountries()
Return the default map of countryCode to subcountries codes/labels mapping.

Returns:
a map of countryCode to subcountries codes/labels mapping.

getCountry2SubCountries

java.util.Map getCountry2SubCountries(java.util.Locale locale)
Return a localized map of countryCode to subcountries codes/labels mapping.

Parameters:
locale - the current locale
Returns:
a localized map of countryCode to subcountries codes/labels mapping.

getCountry2SubCountriesMap

java.util.Map getCountry2SubCountriesMap()
Return the default map of countryCode to subcountries codes/labels mapping.

Returns:
a map of countryCode to subcountries codes/labels mapping.

getSubCountries

java.util.Map getSubCountries(java.lang.String countryCode)
Return the default map of subcountries codes and their labels for the country with the given ISO country code.

Parameters:
countryCode - - ISO country code
Returns:
a map of subcountries codes and their labels for the country with the given ISO country code.

getSubCountries

java.util.Map getSubCountries(java.lang.String countryCode,
                              java.util.Locale locale)
Return a localized map of subcountries codes and their labels for the country with the given ISO country code.

Parameters:
locale - the current locale
countryCode - - ISO country code
Returns:
a map of subcountries codes and their labels for the country with the given ISO country code.

setAvailableRegions

void setAvailableRegions(java.util.List regions)
Set the ShippingRegions that define the set of available countries and subcountries.

Parameters:
regions - a List of ShippingRegions

setPropertiesMap

void setPropertiesMap(java.util.Map propertiesMap)
Set the properties files that are used as a source of Country and SubCountry data.

Parameters:
propertiesMap - the map containing properties data about countries.