com.elasticpath.domain.catalog
Interface ProductSku

All Superinterfaces:
Entity, EpDomain, Persistence, java.io.Serializable
All Known Implementing Classes:
ProductSkuImpl

public interface ProductSku
extends Entity

ProductSku represents a variation of a merchandise product in Elastic Path. A ProductSku corresponds to a single Product


Method Summary
 void addPrice(Price price)
          Convenience method for setting the price.
 void clearPromotionPrice()
          Removes computed promotion prices.
 AttributeValueGroup getAttributeValueGroup()
          Get the attribute value group.
 DigitalAsset getDigitalAsset()
          Gets the digital asset belong to this product SKU.
 java.util.Date getEndDate()
          Get the end date.
 java.lang.String getImage()
          Get the sku default image.
 Inventory getInventory()
          Get the Inventory for this product sku.
 java.util.Set getOptionValueCodes()
          Get the option value codes for this SKU.
 java.util.Map getOptionValueMap()
          Gets the available configuration option values for this SKU.
 java.util.Collection getOptionValues()
          Get the available configuration option values for this SKU.
 Price getPrice(java.util.Currency currency)
          Get the price of this product in the specified currency.
 Price getPriceWithoutFallback(java.util.Currency currency)
          Get the price of this product sku in the specified currency.
 Product getProduct()
          Get the parent product corresponding to this SKU.
 java.util.Map getProductSkuPrices()
          Get the product-price associations belong to this product SKU.
 java.lang.String getSkuCode()
          Get the productSku SKU.
 SkuOptionValue getSkuOptionValue(SkuOption skuOption)
          Returns the value of the given SkuOption.
 ProductSkuSpec getSpec()
          Returns the ProductSkuSpec instance -- the product sku specification.
 java.util.Date getStartDate()
          Get the start date that this productSku will become available to customers.
 boolean hasSufficientInventory(int quantity)
          Returns true if there is sufficient stock of this SKU to sell the specified quantity of items.
 boolean isAvailable()
          Returns true if the product is available to be purchased.
 boolean isShippable()
          True if this SKU is shippable (i.e.
 boolean isVisibleWhenOutOfStock()
          True if this SKU is visible in the when out of stock.
 void setAttributeValueGroup(AttributeValueGroup attributeValueGroup)
          Set the attribute value group.
 void setDigitalAsset(DigitalAsset digitalAsset)
          Sets the digital asset.
 void setEndDate(java.util.Date endDate)
          Set the end date.
 void setImage(java.lang.String image)
          Set the sku default image.
 void setInventory(Inventory inventory)
          Set the Inventory for this product sku.
 void setOptionValueMap(java.util.Map optionValueMap)
          Sets the available configuration option values for this SKU.
 void setProduct(Product product)
          Set the parent product of this SKU.
 void setProductOneWay(Product product)
          Set the parent product of this SKU.
 void setShippable(boolean shippable)
          Sets if this SKU is shippable (i.e.
 void setSkuCode(java.lang.String skuCode)
          Set the SKU for this productSku.
 void setSkuOptionValue(SkuOption skuOption, java.lang.String valueCode)
          Sets the sku option value to the one corresponding given value code.
 void setSpec(ProductSkuSpec spec)
          Sets the ProductSkuSpec instance -- the product sku specification.
 void setStartDate(java.util.Date startDate)
          Set the start date that this productSku will become valid.
 
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
 

Method Detail

addPrice

void addPrice(Price price)
Convenience method for setting the price. If the price exists, its amount is updated. Otherwise the price is added.

Parameters:
price - the price to be added.

clearPromotionPrice

void clearPromotionPrice()
Removes computed promotion prices.


getAttributeValueGroup

AttributeValueGroup getAttributeValueGroup()
Get the attribute value group.

Returns:
the domain model's AttributeValueGroup

getDigitalAsset

DigitalAsset getDigitalAsset()
Gets the digital asset belong to this product SKU.

Returns:
the digital asset belong to this product SKU

getEndDate

java.util.Date getEndDate()
Get the end date. After the end date, the productSku will change to unavailable to customers.

Returns:
the end date

getImage

java.lang.String getImage()
Get the sku default image. Returns the product default image if no sku image exists

Returns:
the sku default image

getInventory

Inventory getInventory()
Get the Inventory for this product sku.

Returns:
the Inventory

getOptionValueCodes

java.util.Set getOptionValueCodes()
Get the option value codes for this SKU.

Returns:
a set of strings of the option value codes

getOptionValueMap

java.util.Map getOptionValueMap()
Gets the available configuration option values for this SKU.

Returns:
a map of SkuOptionValues

getOptionValues

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

Returns:
a collection of SkuOptionValues

getPrice

Price getPrice(java.util.Currency currency)
Get the price of this product in the specified currency.

Parameters:
currency - the Currency of the price to be returned
Returns:
a Price object representing the price in the specified currency. If no price is found, the parent product's price is returned. returns null if no price was found in the specified currency.

getPriceWithoutFallback

Price getPriceWithoutFallback(java.util.Currency currency)
Get the price of this product sku in the specified currency.

Parameters:
currency - the Currency of the price to be returned
Returns:
a Price object representing the price in the specified currency. If no price is found, return null.

getProduct

Product getProduct()
Get the parent product corresponding to this SKU. Note that this column matches the key defined on the TPRODUCTSKU table by Product

Returns:
the parent Product

getProductSkuPrices

java.util.Map getProductSkuPrices()
Get the product-price associations belong to this product SKU.

Returns:
the set of prices corresponding to this product SKU

getSkuCode

java.lang.String getSkuCode()
Get the productSku SKU.

Returns:
the productSku system name

getSkuOptionValue

SkuOptionValue getSkuOptionValue(SkuOption skuOption)
Returns the value of the given SkuOption. Returns null if the value is not defined.

Parameters:
skuOption - the sku option
Returns:
the value of the given SkuOption. null if the value is not defined.

getSpec

ProductSkuSpec getSpec()
Returns the ProductSkuSpec instance -- the product sku specification.

Returns:
the ProductSkuSpec instance -- the product sku specification.

getStartDate

java.util.Date getStartDate()
Get the start date that this productSku will become available to customers.

Returns:
the start date

hasSufficientInventory

boolean hasSufficientInventory(int quantity)
Returns true if there is sufficient stock of this SKU to sell the specified quantity of items.

Parameters:
quantity - the quantity of items to check for availability
Returns:
true if quantity items can be sold

isAvailable

boolean isAvailable()
Returns true if the product is available to be purchased. Currently, this means that the current date is within the start and end dates for this product.

Returns:
true if the product sku is available at today's date.

isShippable

boolean isShippable()
True if this SKU is shippable (i.e. is a physical good which requires shipping).

Returns:
true if this SKU is shippable

isVisibleWhenOutOfStock

boolean isVisibleWhenOutOfStock()
True if this SKU is visible in the when out of stock.

Returns:
true if this SKU is visible in the when out of stock

setAttributeValueGroup

void setAttributeValueGroup(AttributeValueGroup attributeValueGroup)
Set the attribute value group.

Parameters:
attributeValueGroup - the AttributeValueGroup

setDigitalAsset

void setDigitalAsset(DigitalAsset digitalAsset)
Sets the digital asset.

Parameters:
digitalAsset - the digital asset

setEndDate

void setEndDate(java.util.Date endDate)
Set the end date.

Parameters:
endDate - the end date

setImage

void setImage(java.lang.String image)
Set the sku default image.

Parameters:
image - the sku default image

setInventory

void setInventory(Inventory inventory)
Set the Inventory for this product sku.

Parameters:
inventory - the Inventory

setOptionValueMap

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

Parameters:
optionValueMap - the map of SkuOptionValues.

setProduct

void setProduct(Product product)
Set the parent product of this SKU. This method maintains the bidirectional relationships between the given product and the sku. So it will so add this sku to the given product's sku collectin.

Parameters:
product - the parent product

setProductOneWay

void setProductOneWay(Product product)
Set the parent product of this SKU. Notice: this method doesn't maintains the bidirectional relationships between the given product and the sku. It won't add this sku to the given product's sku collectin. This method can be used in some special circumstance to get better performance, like import. Generally, you shouldn't use the given product any more after this method get called because its sku collection is not consistent any more.

Parameters:
product - the parent product

setShippable

void setShippable(boolean shippable)
Sets if this SKU is shippable (i.e. is a physical good which requires shipping).

Parameters:
shippable - the shippable flag for the SKU

setSkuCode

void setSkuCode(java.lang.String skuCode)
Set the SKU for this productSku.

Parameters:
skuCode - the SKU

setSkuOptionValue

void setSkuOptionValue(SkuOption skuOption,
                       java.lang.String valueCode)
                       throws EpInvalidValueBindException
Sets the sku option value to the one corresponding given value code.

Parameters:
skuOption - the sku option
valueCode - the sku option value code
Throws:
EpInvalidValueBindException - in case the given value code is not defined in the given SkuOption

setSpec

void setSpec(ProductSkuSpec spec)
Sets the ProductSkuSpec instance -- the product sku specification.

Parameters:
spec - the product sku specification.

setStartDate

void setStartDate(java.util.Date startDate)
Set the start date that this productSku will become valid.

Parameters:
startDate - the start date