com.elasticpath.domain.shipping.impl
Class ShippingRegionImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractEntityImpl
              extended by com.elasticpath.domain.shipping.impl.ShippingRegionImpl
All Implemented Interfaces:
Entity, EpDomain, Persistence, ShippingRegion, java.io.Serializable

public class ShippingRegionImpl
extends AbstractEntityImpl
implements ShippingRegion

A ShippingRegion represents a region that will be associated with one or more shipping services. It could be composed of countries and country/subCountry combinations. When persisted, the region definition will be saved in a string of format: [countryCode(\(subCountryCode (,subCountryCode)*\))](,[countryCode(\(subCountryCode (,subCountryCode)*\))]?)+ For example, [CA(AB,BC)],[US]

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
ShippingRegionImpl()
           
 
Method Summary
 java.lang.String getName()
          Get the shipping region name.
 java.util.Map getRegionMap()
          Get the Map of regions assoicated with this shippingregion.
 java.lang.String getRegionStr()
          Get the string representation of the region definition (for persistence).
 boolean isInShippionRegion(Address shippingAddress)
          Check if the given shippingAdress is in the range of this ShippingRegion.
 void setName(java.lang.String name)
          Set the shipping region name.
 void setRegionMap(java.util.Map regionMap)
          Set the Map of regions assoicated with this shippingregion.
 void setRegionStr(java.lang.String regionStr)
          Set the string representation of the region definition (for persistence).
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEntityImpl
convertAttributeGroupAttributes, getGuid, setDefaultValues, setGuid
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.Entity
getGuid, setGuid
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
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

ShippingRegionImpl

public ShippingRegionImpl()
Method Detail

getName

public java.lang.String getName()
Get the shipping region name.

Specified by:
getName in interface ShippingRegion
Returns:
the parameter name

getRegionMap

public java.util.Map getRegionMap()
Get the Map of regions assoicated with this shippingregion. The entry of the regionMap is countryCode -> Region.

Specified by:
getRegionMap in interface ShippingRegion
Returns:
the map of regions assoicated with this shippingregion.

getRegionStr

public java.lang.String getRegionStr()
Get the string representation of the region definition (for persistence). Hide this method from interface.

Returns:
the string representation of the region definition.

isInShippionRegion

public boolean isInShippionRegion(Address shippingAddress)
Check if the given shippingAdress is in the range of this ShippingRegion.

Specified by:
isInShippionRegion in interface ShippingRegion
Parameters:
shippingAddress - the shippingAddress to be evaluated. Assume shippingAddress always carries a country code, but subCountry could be null.
Returns:
status of whether the given shippingAdress is in the range of this ShippingRegion.

setName

public void setName(java.lang.String name)
Set the shipping region name.

Specified by:
setName in interface ShippingRegion
Parameters:
name - the parameter name

setRegionMap

public void setRegionMap(java.util.Map regionMap)
Set the Map of regions assoicated with this shippingregion.

Specified by:
setRegionMap in interface ShippingRegion
Parameters:
regionMap - the map of regions to be assoicated with this shippingregion.

setRegionStr

public void setRegionStr(java.lang.String regionStr)
Set the string representation of the region definition (for persistence). Hide this method from interface.

Parameters:
regionStr - the string representation of the region definition