org.broadleafcommerce.core.catalog.domain
Class SkuImpl

java.lang.Object
  extended by org.broadleafcommerce.core.catalog.domain.SkuImpl
All Implemented Interfaces:
Serializable, Sku

@Entity
public class SkuImpl
extends Object
implements Sku

The Class SkuImpl is the default implementation of Sku. A SKU is a specific item that can be sold including any specific attributes of the item such as color or size.

If you want to add fields specific to your implementation of BroadLeafCommerce you should extend this class and add your fields. If you need to make significant changes to the SkuImpl then you should implement your own version of Sku.

This implementation uses a Hibernate implementation of JPA configured through annotations. The Entity references the following tables: BLC_SKU, BLC_SKU_IMAGE

Author:
btaylor
See Also:
Sku}, Serialized Form

Field Summary
protected  Date activeEndDate
          The active end date.
protected  Date activeStartDate
          The active start date.
protected  List<Product> allParentProducts
           
protected  Character available
          The available.
protected  String description
          The description.
protected  Character discountable
          The discountable.
protected  DynamicSkuPrices dynamicPrices
           
protected  Long id
          The id.
protected  String longDescription
          The long description.
protected  String name
          The name.
protected  BigDecimal retailPrice
          The retail price.
protected  BigDecimal salePrice
          The sale price.
protected  List<SkuAttribute> skuAttributes
           
protected  Map<String,String> skuImages
          Deprecated. 
protected  Map<String,Media> skuMedia
          The sku media.
protected  Character taxable
          The taxable.
 
Constructor Summary
SkuImpl()
           
 
Method Summary
 boolean equals(Object obj)
           
 Date getActiveEndDate()
          Returns the the last date that the Sku should be available for sale.
 Date getActiveStartDate()
          Returns the first date that the Sku should be available for sale.
 List<Product> getAllParentProducts()
          Get all the parent products since a sku can exist in multiple
 Boolean getAvailable()
           
 String getDescription()
          Returns the brief description of the Sku.
 Boolean getDiscountable()
           
 Long getId()
          Returns the id of this sku
 Money getListPrice()
          Returns the List Price of the Sku.
 String getLongDescription()
          Returns the long description of the sku.
 String getName()
          Returns the name of the Sku.
 Money getRetailPrice()
          Returns the Retail Price of the Sku.
 Money getSalePrice()
          Returns the Sale Price of the Sku.
 List<SkuAttribute> getSkuAttributes()
           
 String getSkuImage(String imageKey)
          Deprecated. 
 Map<String,String> getSkuImages()
          Deprecated. 
 Map<String,Media> getSkuMedia()
          Returns a map of key/value pairs where the key is a string for the name of a media object and the value is a media object.
 Boolean getTaxable()
           
 int hashCode()
           
 boolean isActive()
          Returns a boolean indicating whether this sku is active.
 boolean isActive(Product product, Category category)
           
 Boolean isAvailable()
          Returns whether the Sku is available.
 Boolean isDiscountable()
          Returns whether the Sku qualifies for discounts or not.
 Boolean isTaxable()
          Returns whether the Sku qualifies for taxes or not.
 void setActiveEndDate(Date activeEndDate)
          Sets the the last date that the Sku should be available for sale.
 void setActiveStartDate(Date activeStartDate)
          Sets the the first date that the Sku should be available for sale.
 void setAllParentProducts(List<Product> allParentProducts)
          Set all the parent products since a sku can exist in multiple
 void setAvailable(Boolean available)
          Sets the whether the Sku is available.
 void setDescription(String description)
          Sets the brief description of the Sku.
 void setDiscountable(Boolean discountable)
          Sets the whether the Sku qualifies for discounts or not.
 void setId(Long id)
          Sets the id of this sku
 void setListPrice(Money listPrice)
          Sets the the List Price of the Sku.
 void setLongDescription(String longDescription)
          Sets the long description of the sku.
 void setName(String name)
          Sets the the name of the Sku.
 void setRetailPrice(Money retailPrice)
           
 void setSalePrice(Money salePrice)
          Sets the the Sale Price of the Sku.
 void setSkuAttributes(List<SkuAttribute> skuAttributes)
           
 void setSkuImages(Map<String,String> skuImages)
          Deprecated. 
 void setSkuMedia(Map<String,Media> skuMedia)
          Sets a map of key/value pairs where the key is a string for the name of a media object and the value is an object of type Media.
 void setTaxable(Boolean taxable)
          Sets the whether the Sku qualifies for taxes or not.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected Long id
The id.


salePrice

protected BigDecimal salePrice
The sale price.


retailPrice

protected BigDecimal retailPrice
The retail price.


name

protected String name
The name.


description

protected String description
The description.


longDescription

protected String longDescription
The long description.


taxable

protected Character taxable
The taxable.


discountable

protected Character discountable
The discountable.


available

protected Character available
The available.


activeStartDate

protected Date activeStartDate
The active start date.


activeEndDate

protected Date activeEndDate
The active end date.


dynamicPrices

protected DynamicSkuPrices dynamicPrices

skuImages

@Deprecated
protected Map<String,String> skuImages
Deprecated. 
The sku images.


skuMedia

protected Map<String,Media> skuMedia
The sku media.


allParentProducts

protected List<Product> allParentProducts

skuAttributes

protected List<SkuAttribute> skuAttributes
Constructor Detail

SkuImpl

public SkuImpl()
Method Detail

getId

public Long getId()
Description copied from interface: Sku
Returns the id of this sku

Specified by:
getId in interface Sku

setId

public void setId(Long id)
Description copied from interface: Sku
Sets the id of this sku

Specified by:
setId in interface Sku

getSalePrice

public Money getSalePrice()
Description copied from interface: Sku
Returns the Sale Price of the Sku. The Sale Price is the standard price the vendor sells this item for.

Specified by:
getSalePrice in interface Sku

setSalePrice

public void setSalePrice(Money salePrice)
Description copied from interface: Sku
Sets the the Sale Price of the Sku. The Sale Price is the standard price the vendor sells this item for.

Specified by:
setSalePrice in interface Sku

getRetailPrice

public Money getRetailPrice()
Description copied from interface: Sku
Returns the Retail Price of the Sku. The Retail Price is the MSRP of the sku.

Specified by:
getRetailPrice in interface Sku

setRetailPrice

public void setRetailPrice(Money retailPrice)
Specified by:
setRetailPrice in interface Sku

getListPrice

public Money getListPrice()
Description copied from interface: Sku
Returns the List Price of the Sku. The List Price is the MSRP of the sku.

Specified by:
getListPrice in interface Sku

setListPrice

public void setListPrice(Money listPrice)
Description copied from interface: Sku
Sets the the List Price of the Sku. The List Price is the MSRP of the sku.

Specified by:
setListPrice in interface Sku

getName

public String getName()
Description copied from interface: Sku
Returns the name of the Sku. The name is a label used to show when displaying the sku.

Specified by:
getName in interface Sku

setName

public void setName(String name)
Description copied from interface: Sku
Sets the the name of the Sku. The name is a label used to show when displaying the sku.

Specified by:
setName in interface Sku

getDescription

public String getDescription()
Description copied from interface: Sku
Returns the brief description of the Sku.

Specified by:
getDescription in interface Sku

setDescription

public void setDescription(String description)
Description copied from interface: Sku
Sets the brief description of the Sku.

Specified by:
setDescription in interface Sku

getLongDescription

public String getLongDescription()
Description copied from interface: Sku
Returns the long description of the sku.

Specified by:
getLongDescription in interface Sku

setLongDescription

public void setLongDescription(String longDescription)
Description copied from interface: Sku
Sets the long description of the sku.

Specified by:
setLongDescription in interface Sku

isTaxable

public Boolean isTaxable()
Description copied from interface: Sku
Returns whether the Sku qualifies for taxes or not. This field is used by the pricing engine to calculate taxes.

Specified by:
isTaxable in interface Sku

getTaxable

public Boolean getTaxable()

setTaxable

public void setTaxable(Boolean taxable)
Description copied from interface: Sku
Sets the whether the Sku qualifies for taxes or not. This field is used by the pricing engine to calculate taxes.

Specified by:
setTaxable in interface Sku

isDiscountable

public Boolean isDiscountable()
Description copied from interface: Sku
Returns whether the Sku qualifies for discounts or not. This field is used by the pricing engine to apply offers.

Specified by:
isDiscountable in interface Sku

getDiscountable

public Boolean getDiscountable()

setDiscountable

public void setDiscountable(Boolean discountable)
Description copied from interface: Sku
Sets the whether the Sku qualifies for discounts or not. This field is used by the pricing engine to apply offers.

Specified by:
setDiscountable in interface Sku

isAvailable

public Boolean isAvailable()
Description copied from interface: Sku
Returns whether the Sku is available.

Specified by:
isAvailable in interface Sku

getAvailable

public Boolean getAvailable()

setAvailable

public void setAvailable(Boolean available)
Description copied from interface: Sku
Sets the whether the Sku is available.

Specified by:
setAvailable in interface Sku

getActiveStartDate

public Date getActiveStartDate()
Description copied from interface: Sku
Returns the first date that the Sku should be available for sale. This field is used to determine whether a user can add the sku to their cart.

Specified by:
getActiveStartDate in interface Sku

setActiveStartDate

public void setActiveStartDate(Date activeStartDate)
Description copied from interface: Sku
Sets the the first date that the Sku should be available for sale. This field is used to determine whether a user can add the sku to their cart.

Specified by:
setActiveStartDate in interface Sku

getActiveEndDate

public Date getActiveEndDate()
Description copied from interface: Sku
Returns the the last date that the Sku should be available for sale. This field is used to determine whether a user can add the sku to their cart.

Specified by:
getActiveEndDate in interface Sku

setActiveEndDate

public void setActiveEndDate(Date activeEndDate)
Description copied from interface: Sku
Sets the the last date that the Sku should be available for sale. This field is used to determine whether a user can add the sku to their cart.

Specified by:
setActiveEndDate in interface Sku

isActive

public boolean isActive()
Description copied from interface: Sku
Returns a boolean indicating whether this sku is active. This is used to determine whether a user the sku can add the sku to their cart.

Specified by:
isActive in interface Sku

isActive

public boolean isActive(Product product,
                        Category category)
Specified by:
isActive in interface Sku

getSkuImages

@Deprecated
public Map<String,String> getSkuImages()
Deprecated. 

Description copied from interface: Sku
Returns a map of key/value pairs where the key is a string for the name of an image and the value is a string to the URL of the image. This is used to display images while browsing the sku. This method is deprecated. Use getSkuMedia instead.

Specified by:
getSkuImages in interface Sku

getSkuImage

@Deprecated
public String getSkuImage(String imageKey)
Deprecated. 

Description copied from interface: Sku
Returns the default image used for the Sku.

Specified by:
getSkuImage in interface Sku

setSkuImages

@Deprecated
public void setSkuImages(Map<String,String> skuImages)
Deprecated. 

Description copied from interface: Sku
Sets a map of key/value pairs where the key is a string for the name of an image and the value is a string to the URL of the image. This is used to display images while browsing the sku. This method is deprecated. Use setSkuMedia instead.

Specified by:
setSkuImages in interface Sku

getSkuMedia

public Map<String,Media> getSkuMedia()
Description copied from interface: Sku
Returns a map of key/value pairs where the key is a string for the name of a media object and the value is a media object.

Specified by:
getSkuMedia in interface Sku

setSkuMedia

public void setSkuMedia(Map<String,Media> skuMedia)
Description copied from interface: Sku
Sets a map of key/value pairs where the key is a string for the name of a media object and the value is an object of type Media.

Specified by:
setSkuMedia in interface Sku

getAllParentProducts

public List<Product> getAllParentProducts()
Description copied from interface: Sku
Get all the parent products since a sku can exist in multiple

Specified by:
getAllParentProducts in interface Sku

setAllParentProducts

public void setAllParentProducts(List<Product> allParentProducts)
Description copied from interface: Sku
Set all the parent products since a sku can exist in multiple

Specified by:
setAllParentProducts in interface Sku

getSkuAttributes

public List<SkuAttribute> getSkuAttributes()
Specified by:
getSkuAttributes in interface Sku
Returns:
the skuAttributes

setSkuAttributes

public void setSkuAttributes(List<SkuAttribute> skuAttributes)
Specified by:
setSkuAttributes in interface Sku
Parameters:
skuAttributes - the skuAttributes to set

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012. All Rights Reserved.