com.elasticpath.domain.shipping.impl
Class RegionImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractTransientImpl
          extended by com.elasticpath.domain.shipping.impl.RegionImpl
All Implemented Interfaces:
EpDomain, Region, Transient, java.io.Serializable

public class RegionImpl
extends AbstractTransientImpl
implements Region

A Region represents a geography definition of an area. For now, it is composed of country and a subcountry, i.e. CA(country) and BC(subcountry).

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
RegionImpl()
          Default constructor.
RegionImpl(java.lang.String countryCode)
          Constructor.
RegionImpl(java.lang.String countryCode, java.util.List subCountryCodeList)
          Constructor.
 
Method Summary
 Region fromString(java.lang.String regionStr)
          Return the Region from parsing the given string representation.
 java.lang.String getCountryCode()
          Get the region's country code (ISO country code).
 java.util.List getSubCountryCodeList()
          Get the region's subcountry code list.
 void mergeSubCountryCodeList(java.util.List additionalSubCountryCodeList)
          Merge the given additionalSubCountryCodeList into the existing subCountryCodeList of this Region instance.
 void setCountryCode(java.lang.String countryCode)
          Set the region's country code (ISO country code).
 void setSubCountryCodeList(java.util.List subCountryCodeList)
          Set the region's subcountry code list.
 java.lang.String toString()
          Return the String representation of this Region.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

RegionImpl

public RegionImpl()
Default constructor.


RegionImpl

public RegionImpl(java.lang.String countryCode)
Constructor.

Parameters:
countryCode - - the ISO country code for this region.

RegionImpl

public RegionImpl(java.lang.String countryCode,
                  java.util.List subCountryCodeList)
Constructor.

Parameters:
countryCode - - the ISO country code for this region.
subCountryCodeList - - the list of ISO subCountry code for this region.
Method Detail

fromString

public Region fromString(java.lang.String regionStr)
Return the Region from parsing the given string representation.

Specified by:
fromString in interface Region
Parameters:
regionStr - - the String representation of the Region
Returns:
Region - the instance of Region

getCountryCode

public java.lang.String getCountryCode()
Get the region's country code (ISO country code).

Specified by:
getCountryCode in interface Region
Returns:
the region's country code.

getSubCountryCodeList

public java.util.List getSubCountryCodeList()
Get the region's subcountry code list.

Specified by:
getSubCountryCodeList in interface Region
Returns:
the region's subcountry code list.

mergeSubCountryCodeList

public void mergeSubCountryCodeList(java.util.List additionalSubCountryCodeList)
Merge the given additionalSubCountryCodeList into the existing subCountryCodeList of this Region instance.

Specified by:
mergeSubCountryCodeList in interface Region
Parameters:
additionalSubCountryCodeList - - the additional subCountryCodeList to be merged in.

setCountryCode

public void setCountryCode(java.lang.String countryCode)
Set the region's country code (ISO country code).

Specified by:
setCountryCode in interface Region
Parameters:
countryCode - the region's country code.

setSubCountryCodeList

public void setSubCountryCodeList(java.util.List subCountryCodeList)
Set the region's subcountry code list.

Specified by:
setSubCountryCodeList in interface Region
Parameters:
subCountryCodeList - the region's subcountry code.

toString

public java.lang.String toString()
Return the String representation of this Region.

Specified by:
toString in interface Region
Overrides:
toString in class java.lang.Object
Returns:
string representation of the region.