com.elasticpath.domain.skuconfiguration.impl
Class SkuOptionImpl

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.skuconfiguration.impl.SkuOptionImpl
All Implemented Interfaces:
Entity, EpDomain, Persistence, SkuOption, java.io.Serializable, java.lang.Cloneable

public class SkuOptionImpl
extends AbstractEntityImpl
implements SkuOption, java.lang.Cloneable

Represents a SKU option that can be configured.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Fields inherited from interface com.elasticpath.domain.skuconfiguration.SkuOption
LOCALIZED_PROPERTY_DISPLAY_NAME
 
Constructor Summary
SkuOptionImpl()
           
 
Method Summary
 void addOptionValue(SkuOptionValue optionValue)
          Add an option value to the set of available values.
 java.lang.Object clone()
          Create a deep copy of this SkuOption.
 boolean contains(java.lang.String valueCode)
          Returns true if this SkuOption contains the given value code.
 SkuOptionValue getDefaultOptionValue()
          Get the option value that has been designated the default value if no option has yet been selected.
 java.lang.String getGuid()
          Return the guid.
 LocalizedProperties getLocalizedProperties()
          Returns the LocalizedProperties.
 java.lang.String getOptionKey()
          Get the key of this SKU option (e.g.
 SkuOptionValue getOptionValue(java.lang.String valueCode)
          Returns the corresponding SkuOptionValue of the given value code.
 java.util.Map getOptionValueMap()
          Get the available values for this SKU option.
 java.util.Collection getOptionValues()
          Get the available values for this SKU option.
 int getOrdering()
          Get the ordering in which this SKU option should appear.
 void setDefaultOptionValue(SkuOptionValue defaultOptionValue)
          Set the option value that is to appear by default if no option has yet been selected.
 void setDefaultValues()
          Set default values for those fields need default values.
 void setGuid(java.lang.String guid)
          Set the guid.
 void setLocalizedProperties(LocalizedProperties localizedProperties)
          Sets the LocalizedProperties.
 void setOptionKey(java.lang.String optionKey)
          Set the key of this SKU option.
 void setOptionValueMap(java.util.Map optionValueMap)
          Set the available values for this SKU option.
 void setOptionValues(java.util.Set optionValues)
          Sets the available values for this SKU option.
 void setOrdering(int ordering)
          Set the ordering in which this SKU option should appear.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEntityImpl
convertAttributeGroupAttributes
 
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.Persistence
executeBeforePersistAction, getUidPk, isPersistent, 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

SkuOptionImpl

public SkuOptionImpl()
Method Detail

addOptionValue

public void addOptionValue(SkuOptionValue optionValue)
Add an option value to the set of available values.

Specified by:
addOptionValue in interface SkuOption
Parameters:
optionValue - an OptionValue

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Create a deep copy of this SkuOption.

Specified by:
clone in interface SkuOption
Overrides:
clone in class java.lang.Object
Returns:
a deep copy
Throws:
java.lang.CloneNotSupportedException - if the object cannot be cloned

contains

public boolean contains(java.lang.String valueCode)
Returns true if this SkuOption contains the given value code.

Specified by:
contains in interface SkuOption
Parameters:
valueCode - the sku option value code
Returns:
true if this SkuOption contains the given value code

getDefaultOptionValue

public SkuOptionValue getDefaultOptionValue()
Get the option value that has been designated the default value if no option has yet been selected. Note that the default option value is computed based on the default SKU and is not persisted

Specified by:
getDefaultOptionValue in interface SkuOption
Returns:
the default SkuOptionValue

getGuid

public java.lang.String getGuid()
Return the guid.

Specified by:
getGuid in interface Entity
Overrides:
getGuid in class AbstractEntityImpl
Returns:
the guid.

getLocalizedProperties

public LocalizedProperties getLocalizedProperties()
Returns the LocalizedProperties.

Specified by:
getLocalizedProperties in interface SkuOption
Returns:
the LocalizedProperties

getOptionKey

public java.lang.String getOptionKey()
Get the key of this SKU option (e.g. Color).

Specified by:
getOptionKey in interface SkuOption
Returns:
the SKU option key.

getOptionValue

public SkuOptionValue getOptionValue(java.lang.String valueCode)
Returns the corresponding SkuOptionValue of the given value code.

Specified by:
getOptionValue in interface SkuOption
Parameters:
valueCode - the sku option value code
Returns:
the corresponding SkuOptionValue of the given value code

getOptionValueMap

public java.util.Map getOptionValueMap()
Get the available values for this SKU option.

Specified by:
getOptionValueMap in interface SkuOption
Returns:
a map of SkuValues

getOptionValues

public java.util.Collection getOptionValues()
Get the available values for this SKU option.

Specified by:
getOptionValues in interface SkuOption
Returns:
a set of SkuValues

getOrdering

public int getOrdering()
Get the ordering in which this SKU option should appear.

Specified by:
getOrdering in interface SkuOption
Returns:
the ordering number

setDefaultOptionValue

public void setDefaultOptionValue(SkuOptionValue defaultOptionValue)
Set the option value that is to appear by default if no option has yet been selected. Note that the default option value is computed based on the default SKU and is not persisted

Specified by:
setDefaultOptionValue in interface SkuOption
Parameters:
defaultOptionValue - the default SkuOptionValue

setDefaultValues

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

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

setGuid

public void setGuid(java.lang.String guid)
Set the guid.

Specified by:
setGuid in interface Entity
Overrides:
setGuid in class AbstractEntityImpl
Parameters:
guid - the guid to set.

setLocalizedProperties

public void setLocalizedProperties(LocalizedProperties localizedProperties)
Sets the LocalizedProperties.

Parameters:
localizedProperties - the LocalizedProperties

setOptionKey

public void setOptionKey(java.lang.String optionKey)
Set the key of this SKU option.

Specified by:
setOptionKey in interface SkuOption
Parameters:
optionKey - the key of the option (e.g. Color).

setOptionValueMap

public void setOptionValueMap(java.util.Map optionValueMap)
Set the available values for this SKU option.

Specified by:
setOptionValueMap in interface SkuOption
Parameters:
optionValueMap - the map of SkuValues.

setOptionValues

public void setOptionValues(java.util.Set optionValues)
Sets the available values for this SKU option.

Specified by:
setOptionValues in interface SkuOption
Parameters:
optionValues - a set of SkuOptionValues

setOrdering

public void setOrdering(int ordering)
Set the ordering in which this SKU option should appear.

Specified by:
setOrdering in interface SkuOption
Parameters:
ordering - the ordering number