com.elasticpath.domain.order.impl
Class OrderSkuImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractValueObjectImpl
              extended by com.elasticpath.domain.order.impl.OrderSkuImpl
All Implemented Interfaces:
EpDomain, OrderSku, Persistence, ValueObject, java.io.Serializable

public class OrderSkuImpl
extends AbstractValueObjectImpl
implements OrderSku

Represents an order for a quantity of SKUs.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
OrderSkuImpl()
           
 
Method Summary
 java.math.BigDecimal getAmount()
          Get the amount for this sku (Price * Quantity).
 Money getAmountMoney(java.util.Currency currency)
          Get the amount as a Money object.
 java.util.Date getCreatedDate()
          Get the date that this order was created on.
 DigitalAsset getDigitalAsset()
          Gets the digital asset belong to this order SKU.
 java.lang.String getDisplayName()
          Get the product's display name.
 java.lang.String getDisplayNameCsr()
          Get the product's display name in the CSR language.
 java.lang.String getDisplaySkuOptions()
          Get the product's option values for display.
 Money getDollarSavingsMoney(java.util.Currency currency)
          Calculates the MoneyImpl savings if the price has a discount.
 java.lang.String getEncryptedUidPk()
          Get the encrypted uidPk string.
 java.lang.String getImage()
          Get the product's image path.
 CmUser getLastModifiedBy()
          Get the CM user who last modifed this order sku.
 java.util.Date getLastModifiedDate()
          Get the date that the order was last modified on.
 java.math.BigDecimal getListPrice()
          Get the list price for this sku.
 Money getListPriceMoney(java.util.Currency currency)
          Get the list price as a Money object.
 Product getProduct()
          Get the parent product corresponding to this SKU.
 ProductSku getProductSku()
          Get the product sku sold.
 long getProductSkuUid()
          Get the product sku uid corrsponding to this OrderSku.
 long getProductUid()
          Get the parent product uid corresponding to this OrderSku.
 int getQuantity()
          Get the quantity of this sku ordered.
 java.math.BigDecimal getSavings()
          Calculates the BigDecimal savings if any.
 java.lang.String getSkuCode()
          Get the productSku SKU.
 java.math.BigDecimal getTax()
          Get the tax amount.
 java.lang.String getTaxCode()
          Gets the tax code for this order SKU.
 java.math.BigDecimal getUnitPrice()
          Get the unit price for this sku.
 Money getUnitPriceMoney(java.util.Currency currency)
          Get the unit price as a Money object.
 int getWeight()
          Returns the shipping weight.
 boolean isUnitLessThanList(java.util.Currency currency)
          Check if the unit price is less than the list price, i.e.
 void setAmount(java.math.BigDecimal amount)
          Set the amount for this sku (Price * Quantity).
 void setCreatedDate(java.util.Date createdDate)
          Set the date that the order is created.
 void setDigitalAsset(DigitalAsset digitalAsset)
          Sets the digital asset.
 void setDisplayName(java.lang.String displayName)
          Set the product's display name.
 void setDisplayNameCsr(java.lang.String displayNameCsr)
          Set the product's display name in the CSR language.
 void setDisplaySkuOptions(java.lang.String displaySkuOptions)
          Set the product's option values for display.
 void setImage(java.lang.String image)
          Set the product's image path.
 void setLastModifiedBy(CmUser modifiedBy)
          Set the CM User who last modified this order sku.
 void setLastModifiedDate(java.util.Date lastModifiedDate)
          Set the date that the order was last modified on.
 void setListPrice(java.math.BigDecimal price)
          Set the amount for this sku.
 void setProduct(Product product)
          Set the parent product of this SKU.
 void setProductSku(ProductSku productSku)
          Set the product sku sold.
 void setProductSkuUid(long productSkuUid)
          Set the product sku uid.
 void setProductUid(long productUid)
          Set the parent product uid of this SKU.
 void setQuantity(int quantity)
          Set the quantity of this sku ordered.
 void setSkuCode(java.lang.String skuCode)
          Set the SKU for this productSku.
 void setTax(java.math.BigDecimal tax)
          Set the tax amount.
 void setTaxCode(java.lang.String taxCode)
          Sets the tax code for this order SKU.
 void setUnitPrice(java.math.BigDecimal price)
          Set the unit price for this sku.
 void setWeight(int weight)
          Sets the shipping weight.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, 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, 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

OrderSkuImpl

public OrderSkuImpl()
Method Detail

getAmount

public java.math.BigDecimal getAmount()
Get the amount for this sku (Price * Quantity).

Specified by:
getAmount in interface OrderSku
Returns:
the amount

getAmountMoney

public Money getAmountMoney(java.util.Currency currency)
Get the amount as a Money object.

Specified by:
getAmountMoney in interface OrderSku
Parameters:
currency - The currency of the order.
Returns:
a Money object representing the total price

getCreatedDate

public java.util.Date getCreatedDate()
Get the date that this order was created on.

Specified by:
getCreatedDate in interface OrderSku
Returns:
the created date

getDigitalAsset

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

Specified by:
getDigitalAsset in interface OrderSku
Returns:
the digital asset belong to this order SKU

getDisplayName

public java.lang.String getDisplayName()
Get the product's display name.

Specified by:
getDisplayName in interface OrderSku
Returns:
the product's display name.

getDisplayNameCsr

public java.lang.String getDisplayNameCsr()
Get the product's display name in the CSR language.

Specified by:
getDisplayNameCsr in interface OrderSku
Returns:
the product's display name in the CSR language.

getDisplaySkuOptions

public java.lang.String getDisplaySkuOptions()
Get the product's option values for display.

Specified by:
getDisplaySkuOptions in interface OrderSku
Returns:
the product's option values for display.

getDollarSavingsMoney

public Money getDollarSavingsMoney(java.util.Currency currency)
Calculates the MoneyImpl savings if the price has a discount.

Specified by:
getDollarSavingsMoney in interface OrderSku
Parameters:
currency - The currency of the order.
Returns:
the price savings as a MoneyImpl

getEncryptedUidPk

public java.lang.String getEncryptedUidPk()
Get the encrypted uidPk string.

Specified by:
getEncryptedUidPk in interface OrderSku
Returns:
the encrypted uidPk string

getImage

public java.lang.String getImage()
Get the product's image path.

Specified by:
getImage in interface OrderSku
Returns:
the product's image path.

getLastModifiedBy

public CmUser getLastModifiedBy()
Get the CM user who last modifed this order sku.

Specified by:
getLastModifiedBy in interface OrderSku
Returns:
the CM user

getLastModifiedDate

public java.util.Date getLastModifiedDate()
Get the date that the order was last modified on.

Specified by:
getLastModifiedDate in interface OrderSku
Returns:
the last modified date

getListPrice

public java.math.BigDecimal getListPrice()
Get the list price for this sku.

Specified by:
getListPrice in interface OrderSku
Returns:
the price

getListPriceMoney

public Money getListPriceMoney(java.util.Currency currency)
Get the list price as a Money object.

Specified by:
getListPriceMoney in interface OrderSku
Parameters:
currency - The currency of the order.
Returns:
a Money object representing the list price

getProduct

public Product getProduct()
Get the parent product corresponding to this SKU. Note: this is not proloaded and could be null if the product corresponding to the saved productUid is deleted.

Specified by:
getProduct in interface OrderSku
Returns:
the parent Product or null if the product is unknown

getProductSku

public ProductSku getProductSku()
Get the product sku sold. Note: this is not proloaded and could be null if the product sku corresponding to the saved productSkuUid is deleted.

Specified by:
getProductSku in interface OrderSku
Returns:
the product sku or null if unknown

getProductSkuUid

public long getProductSkuUid()
Get the product sku uid corrsponding to this OrderSku.

Specified by:
getProductSkuUid in interface OrderSku
Returns:
the product sku uid

getProductUid

public long getProductUid()
Get the parent product uid corresponding to this OrderSku. Note that this value matches the key defined on the TPRODUCTSKU table by Product

Specified by:
getProductUid in interface OrderSku
Returns:
the parent Product uid

getQuantity

public int getQuantity()
Get the quantity of this sku ordered.

Specified by:
getQuantity in interface OrderSku
Returns:
the quantity

getSavings

public java.math.BigDecimal getSavings()
Calculates the BigDecimal savings if any.

Specified by:
getSavings in interface OrderSku
Returns:
the price savings as a MoneyImpl

getSkuCode

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

Specified by:
getSkuCode in interface OrderSku
Returns:
the productSku system name

getTax

public java.math.BigDecimal getTax()
Get the tax amount.

Specified by:
getTax in interface OrderSku
Returns:
the tax amount

getTaxCode

public java.lang.String getTaxCode()
Gets the tax code for this order SKU.

Specified by:
getTaxCode in interface OrderSku
Returns:
the tax code for this order SKU.

getUnitPrice

public java.math.BigDecimal getUnitPrice()
Get the unit price for this sku.

Specified by:
getUnitPrice in interface OrderSku
Returns:
the price

getUnitPriceMoney

public Money getUnitPriceMoney(java.util.Currency currency)
Get the unit price as a Money object.

Specified by:
getUnitPriceMoney in interface OrderSku
Parameters:
currency - The currency of the order.
Returns:
a Money object representing the unit price

getWeight

public int getWeight()
Returns the shipping weight.

Specified by:
getWeight in interface OrderSku
Returns:
the shipping weight.

isUnitLessThanList

public boolean isUnitLessThanList(java.util.Currency currency)
Check if the unit price is less than the list price, i.e. the price has a discount.

Specified by:
isUnitLessThanList in interface OrderSku
Parameters:
currency - The currency of the order.
Returns:
true if the price has a lower price than the list price.

setAmount

public void setAmount(java.math.BigDecimal amount)
Set the amount for this sku (Price * Quantity).

Specified by:
setAmount in interface OrderSku
Parameters:
amount - the amount

setCreatedDate

public void setCreatedDate(java.util.Date createdDate)
Set the date that the order is created.

Specified by:
setCreatedDate in interface OrderSku
Parameters:
createdDate - the start date

setDigitalAsset

public void setDigitalAsset(DigitalAsset digitalAsset)
Sets the digital asset.

Specified by:
setDigitalAsset in interface OrderSku
Parameters:
digitalAsset - the digital asset

setDisplayName

public void setDisplayName(java.lang.String displayName)
Set the product's display name.

Specified by:
setDisplayName in interface OrderSku
Parameters:
displayName - the product's display name

setDisplayNameCsr

public void setDisplayNameCsr(java.lang.String displayNameCsr)
Set the product's display name in the CSR language.

Specified by:
setDisplayNameCsr in interface OrderSku
Parameters:
displayNameCsr - the product's display name in the CSR language.

setDisplaySkuOptions

public void setDisplaySkuOptions(java.lang.String displaySkuOptions)
Set the product's option values for display.

Specified by:
setDisplaySkuOptions in interface OrderSku
Parameters:
displaySkuOptions - the product's option values for display

setImage

public void setImage(java.lang.String image)
Set the product's image path.

Specified by:
setImage in interface OrderSku
Parameters:
image - the product's image path

setLastModifiedBy

public void setLastModifiedBy(CmUser modifiedBy)
Set the CM User who last modified this order sku.

Specified by:
setLastModifiedBy in interface OrderSku
Parameters:
modifiedBy - the CM user

setLastModifiedDate

public void setLastModifiedDate(java.util.Date lastModifiedDate)
Set the date that the order was last modified on.

Specified by:
setLastModifiedDate in interface OrderSku
Parameters:
lastModifiedDate - the date that the order was last modified

setListPrice

public void setListPrice(java.math.BigDecimal price)
Set the amount for this sku.

Specified by:
setListPrice in interface OrderSku
Parameters:
price - the price

setProduct

public void setProduct(Product product)
Set the parent product of this SKU.

Specified by:
setProduct in interface OrderSku
Parameters:
product - the parent product

setProductSku

public void setProductSku(ProductSku productSku)
Set the product sku sold.

Specified by:
setProductSku in interface OrderSku
Parameters:
productSku - the product sku

setProductSkuUid

public void setProductSkuUid(long productSkuUid)
Set the product sku uid.

Specified by:
setProductSkuUid in interface OrderSku
Parameters:
productSkuUid - the product sku uid

setProductUid

public void setProductUid(long productUid)
Set the parent product uid of this SKU.

Specified by:
setProductUid in interface OrderSku
Parameters:
productUid - the parent productUid

setQuantity

public void setQuantity(int quantity)
Set the quantity of this sku ordered.

Specified by:
setQuantity in interface OrderSku
Parameters:
quantity - the quantity

setSkuCode

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

Specified by:
setSkuCode in interface OrderSku
Parameters:
skuCode - the SKU

setTax

public void setTax(java.math.BigDecimal tax)
Set the tax amount.

Specified by:
setTax in interface OrderSku
Parameters:
tax - the tax amount

setTaxCode

public void setTaxCode(java.lang.String taxCode)
Sets the tax code for this order SKU.

Specified by:
setTaxCode in interface OrderSku
Parameters:
taxCode - the tax code for this order SKU.

setUnitPrice

public void setUnitPrice(java.math.BigDecimal price)
Set the unit price for this sku.

Specified by:
setUnitPrice in interface OrderSku
Parameters:
price - the price

setWeight

public void setWeight(int weight)
Sets the shipping weight.

Specified by:
setWeight in interface OrderSku
Parameters:
weight - the shipping weight to set.