|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.elasticpath.domain.impl.AbstractEpDomainImpl com.elasticpath.domain.impl.AbstractPersistenceImpl com.elasticpath.domain.impl.AbstractEntityImpl com.elasticpath.domain.catalog.impl.ProductSkuImpl
public class ProductSkuImpl
ProductSku
represents a variation of a merchandise product in Elastic Path. A ProductSku
corresponds to a single
Product
NOTE: The way prices are implemented and retrieved may need some refactoring as requirements are further developed.
Field Summary | |
---|---|
static long |
serialVersionUID
Serial version id. |
Constructor Summary | |
---|---|
ProductSkuImpl()
Default constructor. |
Method Summary | |
---|---|
void |
addPrice(Price price)
Convenience method for setting the price. |
void |
clearPromotionPrice()
Removes computed promotion prices. |
boolean |
equals(java.lang.Object obj)
Returns true if this sku equals to the given object. |
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 |
getGuid()
Return the guid. |
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 values for this SKU option. |
Price |
getPrice(java.util.Currency currency)
Get the price of this product sku 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 product system name. |
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 product will become available to customers. |
int |
hashCode()
Hash code. |
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 |
setDefaultValues()
Set default values for those fields need default values. |
void |
setDigitalAsset(DigitalAsset digitalAsset)
Sets the digital asset. |
void |
setEndDate(java.util.Date endDate)
Set the end date. |
void |
setGuid(java.lang.String guid)
Set the guid. |
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 newProduct)
Set the parent product of this SKU. |
void |
setProductOneWay(Product product)
Set the parent product of this SKU. |
void |
setProductSkuPrices(java.util.Map productSkuPrices)
Set the product-price assocations of this product SKU. |
void |
setShippable(boolean shippable)
Sets if this SKU is shippable (i.e. |
void |
setSkuCode(java.lang.String skuCode)
Set the SKU for this product variation. |
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 product will become valid. |
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 |
---|
getClass, 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 |
---|
public static final long serialVersionUID
Constructor Detail |
---|
public ProductSkuImpl()
Method Detail |
---|
public void addPrice(Price price)
addPrice
in interface ProductSku
price
- the price to be added.public void clearPromotionPrice()
clearPromotionPrice
in interface ProductSku
public boolean equals(java.lang.Object obj)
true
if this sku equals to the given object.
equals
in class java.lang.Object
obj
- the given object
true
if this sku equals to the given objectpublic AttributeValueGroup getAttributeValueGroup()
getAttributeValueGroup
in interface ProductSku
AttributeValueGroup
public DigitalAsset getDigitalAsset()
getDigitalAsset
in interface ProductSku
public java.util.Date getEndDate()
getEndDate
in interface ProductSku
public java.lang.String getGuid()
getGuid
in interface Entity
getGuid
in class AbstractEntityImpl
public java.lang.String getImage()
getImage
in interface ProductSku
public Inventory getInventory()
Inventory
for this product sku.
getInventory
in interface ProductSku
Inventory
public java.util.Set getOptionValueCodes()
getOptionValueCodes
in interface ProductSku
public java.util.Map getOptionValueMap()
getOptionValueMap
in interface ProductSku
SkuOptionValue
spublic java.util.Collection getOptionValues()
getOptionValues
in interface ProductSku
SkuOptionValue
spublic Price getPrice(java.util.Currency currency)
getPrice
in interface ProductSku
currency
- the Currency
of the price to be returned
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.public Price getPriceWithoutFallback(java.util.Currency currency)
getPriceWithoutFallback
in interface ProductSku
currency
- the Currency
of the price to be returned
Price
object representing the price in the specified currency. If no price is found, return null
.public Product getProduct()
getProduct
in interface ProductSku
Product
public java.util.Map getProductSkuPrices()
getProductSkuPrices
in interface ProductSku
public java.lang.String getSkuCode()
getSkuCode
in interface ProductSku
public SkuOptionValue getSkuOptionValue(SkuOption skuOption)
SkuOption
. Returns null
if the value is not defined.
getSkuOptionValue
in interface ProductSku
skuOption
- the sku option
SkuOption
. null
if the value is not defined.public ProductSkuSpec getSpec()
ProductSkuSpec
instance -- the product sku specification.
getSpec
in interface ProductSku
ProductSkuSpec
instance -- the product sku specification.public java.util.Date getStartDate()
getStartDate
in interface ProductSku
public int hashCode()
hashCode
in class java.lang.Object
public boolean hasSufficientInventory(int quantity)
hasSufficientInventory
in interface ProductSku
quantity
- the quantity of items to check for availability
quantity
items can be soldpublic boolean isAvailable()
isAvailable
in interface ProductSku
public boolean isShippable()
isShippable
in interface ProductSku
public boolean isVisibleWhenOutOfStock()
isVisibleWhenOutOfStock
in interface ProductSku
public void setAttributeValueGroup(AttributeValueGroup attributeValueGroup)
setAttributeValueGroup
in interface ProductSku
attributeValueGroup
- the AttributeValueGroup
public void setDefaultValues()
setDefaultValues
in interface Persistence
setDefaultValues
in class AbstractEntityImpl
public void setDigitalAsset(DigitalAsset digitalAsset)
setDigitalAsset
in interface ProductSku
digitalAsset
- the digital assetpublic void setEndDate(java.util.Date endDate)
setEndDate
in interface ProductSku
endDate
- the end datepublic void setGuid(java.lang.String guid)
setGuid
in interface Entity
setGuid
in class AbstractEntityImpl
guid
- the guid to set.public void setImage(java.lang.String image)
setImage
in interface ProductSku
image
- the sku default imagepublic void setInventory(Inventory inventory)
Inventory
for this product sku.
setInventory
in interface ProductSku
inventory
- the Inventory
public void setOptionValueMap(java.util.Map optionValueMap)
setOptionValueMap
in interface ProductSku
optionValueMap
- the map of SkuOptionValue
s.public void setProduct(Product newProduct)
setProduct
in interface ProductSku
newProduct
- the parent productpublic void setProductOneWay(Product product)
setProductOneWay
in interface ProductSku
product
- the parent productpublic void setProductSkuPrices(java.util.Map productSkuPrices)
productSkuPrices
- the product SKU prices to setpublic void setShippable(boolean shippable)
setShippable
in interface ProductSku
shippable
- the shippable flag for the SKUpublic void setSkuCode(java.lang.String skuCode)
setSkuCode
in interface ProductSku
skuCode
- the SKUpublic void setSkuOptionValue(SkuOption skuOption, java.lang.String valueCode) throws EpInvalidValueBindException
setSkuOptionValue
in interface ProductSku
skuOption
- the sku optionvalueCode
- the sku option value code
EpInvalidValueBindException
- in case the given value code is not defined in the given SkuOption
public void setSpec(ProductSkuSpec spec)
ProductSkuSpec
instance -- the product sku specification.
setSpec
in interface ProductSku
spec
- the product sku specification.public void setStartDate(java.util.Date startDate)
setStartDate
in interface ProductSku
startDate
- the start date
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |