com.elasticpath.domain.customer.impl
Class CustomerProfileImpl

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.customer.impl.CustomerProfileImpl
All Implemented Interfaces:
CustomerProfile, Entity, EpDomain, Persistence, java.io.Serializable

public class CustomerProfileImpl
extends AbstractEntityImpl
implements CustomerProfile

This is a default implementation of CustomerProfile.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
CustomerProfileImpl()
           
 
Method Summary
 ElasticPath getElasticPath()
          Get the ElasticPath singleton.
 java.util.List getFullAttributeValues()
          Get a list of AttributeValues for all attributes defined as the customer profile usage.
 java.lang.Object getProfileValue(java.lang.String attributeKey)
          Get the value of a profile with the specified key in default locale.
 java.util.Map getProfileValueMap()
          Returns the attribute value map.
 java.lang.String getStringProfileValue(java.lang.String attributeKey)
          Get the value of a string profile with the specified key.
 void setDefaultValues()
          Set default values for those fields need default values.
 void setProfileValue(java.lang.String attributeKey, java.lang.Object value)
          Set the customer profile value based on the given pair of key/object.
 void setProfileValueMap(java.util.Map profileValueMap)
          Sets the attribute value map.
 void setStringProfileValue(java.lang.String attributeKey, java.lang.String stringValue)
          Set the customer profile value based on the given string value.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEntityImpl
convertAttributeGroupAttributes, getGuid, setGuid
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

CustomerProfileImpl

public CustomerProfileImpl()
Method Detail

getElasticPath

public ElasticPath getElasticPath()
Get the ElasticPath singleton.

Specified by:
getElasticPath in interface EpDomain
Overrides:
getElasticPath in class AbstractEpDomainImpl
Returns:
elasticpath the ElasticPath singleton.

getFullAttributeValues

public java.util.List getFullAttributeValues()
Get a list of AttributeValues for all attributes defined as the customer profile usage. If an attribute in the customer profile usage has a value, the value will be returned. Otherwise, a null value will be returned.

Returns:
a list of AttributeValues

getProfileValue

public java.lang.Object getProfileValue(java.lang.String attributeKey)
Get the value of a profile with the specified key in default locale.

Specified by:
getProfileValue in interface CustomerProfile
Parameters:
attributeKey - the key of the profile to be retrieved
Returns:
the value of the attribute

getProfileValueMap

public java.util.Map getProfileValueMap()
Returns the attribute value map.

Specified by:
getProfileValueMap in interface CustomerProfile
Returns:
the attribute value map

getStringProfileValue

public java.lang.String getStringProfileValue(java.lang.String attributeKey)
Get the value of a string profile with the specified key.

Specified by:
getStringProfileValue in interface CustomerProfile
Parameters:
attributeKey - the key of the profile to be retrieved
Returns:
the String value of the attribute

setDefaultValues

public void setDefaultValues()
Set default values for those fields need default values.

Specified by:
setDefaultValues in interface Persistence
Overrides:
setDefaultValues in class AbstractEntityImpl

setProfileValue

public void setProfileValue(java.lang.String attributeKey,
                            java.lang.Object value)
Set the customer profile value based on the given pair of key/object.

Specified by:
setProfileValue in interface CustomerProfile
Parameters:
attributeKey - the attribute Key to set the value
value - the object to set the value
Throws:
EpBindException - in case the given object is invalid

setProfileValueMap

public void setProfileValueMap(java.util.Map profileValueMap)
Sets the attribute value map.

Specified by:
setProfileValueMap in interface CustomerProfile
Parameters:
profileValueMap - the attribute value map

setStringProfileValue

public void setStringProfileValue(java.lang.String attributeKey,
                                  java.lang.String stringValue)
                           throws EpBindException
Set the customer profile value based on the given string value.

Specified by:
setStringProfileValue in interface CustomerProfile
Parameters:
attributeKey - the attribute Key to set the value
stringValue - the string value
Throws:
EpBindException - in case the given string value is invalid