com.konakart.app
Class Basket

java.lang.Object
  extended by com.konakart.app.Basket
All Implemented Interfaces:
BasketIf

public class Basket
extends java.lang.Object
implements BasketIf

Basket class


Constructor Summary
Basket()
          Constructor
Basket(com.workingdogs.village.Record vr, KKCriteria c)
          Instantiates the attributes of the Basket object from a Record object
 
Method Summary
 java.math.BigDecimal calculatePrice(int scale)
          Calculate the price of the basket item
 java.lang.String getCustom1()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 java.lang.String getCustom4()
           
 java.lang.String getCustom5()
           
 java.util.Calendar getDateAdded()
           
 java.util.Calendar getDateAvailable()
          The date when the product will become available
 java.lang.String getEncodedProduct()
          The encodedProduct is in the form 1{3}5{4}1 where the first number is the product id.
 java.math.BigDecimal getFinalPriceExTax()
          This is the price without including tax.
 java.math.BigDecimal getFinalPriceIncTax()
          This is the price including tax.
 int getId()
           
 OptionIf[] getOpts()
          An array of Option objects that further defines the product.
 ProductIf getProduct()
           
 int getProductId()
           
 int getQuantity()
           
 int getQuantityInStock()
           
 java.lang.String getSku()
          The SKU of the product
 int getWishListId()
          Set to the id of the wish list (gift registry) to keep track that it has been added from a gift registry.
 int getWishListItemId()
          Set to the id of the wish list item (gift registry item) to keep track that it has been added from a gift registry and which item it corresponds to.
 boolean isUseBasketPrice()
          When set, the price of the basket object is used rather than getting the price from the product object.
 void setCustom1(java.lang.String custom1)
           
 void setCustom2(java.lang.String custom2)
           
 void setCustom3(java.lang.String custom3)
           
 void setCustom4(java.lang.String custom4)
           
 void setCustom5(java.lang.String custom5)
           
 void setDateAdded(java.util.Calendar dateAdded)
           
 void setDateAvailable(java.util.Calendar dateAvailable)
          The date when the product will become available
 void setEncodedProduct(java.lang.String encodedProduct)
          The encodedProduct is in the form 1{3}5{4}1 where the first number is the product id.
 void setFinalPriceExTax(java.math.BigDecimal finalPriceExTax)
          This is the price without including tax.
 void setFinalPriceIncTax(java.math.BigDecimal finalPriceIncTax)
          This is the price including tax.
 void setId(int id)
           
 void setOpts(OptionIf[] opts)
          An array of Option objects that further defines the product.
 void setProduct(ProductIf product)
           
 void setProductId(int productId)
           
 void setQuantity(int quantity)
           
 void setQuantityInStock(int quantityInStock)
           
 void setSku(java.lang.String sku)
          The SKU of the product
 void setUseBasketPrice(boolean useBasketPrice)
          When set, the price of the basket object is used rather than getting the price from the product object.
 void setWishListId(int wishListId)
          Set to the id of the wish list (gift registry) to keep track that it has been added from a gift registry.
 void setWishListItemId(int wishListItemId)
          Set to the id of the wish list item (gift registry item) to keep track that it has been added from a gift registry and which item it corresponds to.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Basket

public Basket()
Constructor


Basket

public Basket(com.workingdogs.village.Record vr,
              KKCriteria c)
       throws com.workingdogs.village.DataSetException
Instantiates the attributes of the Basket object from a Record object

Parameters:
vr - Record containing data
c - Criteria containing column names
Throws:
com.workingdogs.village.DataSetException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Returns a string containing the attributes of the Basket object and those of its Options.

calculatePrice

public java.math.BigDecimal calculatePrice(int scale)
                                    throws KKException
Calculate the price of the basket item

Parameters:
scale -
Returns:
Return the total price of this basket item including the chosen options and any special price that may be available.
Throws:
KKException

getDateAdded

public java.util.Calendar getDateAdded()
Specified by:
getDateAdded in interface BasketIf
Returns:
Returns the dateAdded.

setDateAdded

public void setDateAdded(java.util.Calendar dateAdded)
Specified by:
setDateAdded in interface BasketIf
Parameters:
dateAdded - The dateAdded to set.

getEncodedProduct

public java.lang.String getEncodedProduct()
Description copied from interface: BasketIf
The encodedProduct is in the form 1{3}5{4}1 where the first number is the product id. The number pairs following the first number define the {OptionId}OptionValueId . For example this could be Model Type = Premium or Memory size = 1GB etc. If the basket has an encoded product, then it should have an array of Options that match the encoded product.

Specified by:
getEncodedProduct in interface BasketIf
Returns:
Returns the encodedProduct.

setEncodedProduct

public void setEncodedProduct(java.lang.String encodedProduct)
Description copied from interface: BasketIf
The encodedProduct is in the form 1{3}5{4}1 where the first number is the product id. The number pairs following the first number define the {OptionId}OptionValueId . For example this could be Model Type = Premium or Memory size = 1GB etc. If the basket has an encoded product, then it should have an array of Options that match the encoded product.

Specified by:
setEncodedProduct in interface BasketIf
Parameters:
encodedProduct - The encodedProduct to set.

getId

public int getId()
Specified by:
getId in interface BasketIf
Returns:
Returns the id.

setId

public void setId(int id)
Specified by:
setId in interface BasketIf
Parameters:
id - The id to set.

getOpts

public OptionIf[] getOpts()
Description copied from interface: BasketIf
An array of Option objects that further defines the product. i.e. Size = small, color = blue. The encodedProductId should match this array of options.

Specified by:
getOpts in interface BasketIf
Returns:
Returns the opts.

setOpts

public void setOpts(OptionIf[] opts)
Description copied from interface: BasketIf
An array of Option objects that further defines the product. i.e. Size = small, color = blue. The encodedProductId should match this array of options.

Specified by:
setOpts in interface BasketIf
Parameters:
opts - The opts to set.

getProduct

public ProductIf getProduct()
Specified by:
getProduct in interface BasketIf
Returns:
Returns the product.

setProduct

public void setProduct(ProductIf product)
Specified by:
setProduct in interface BasketIf
Parameters:
product - The product to set.

getProductId

public int getProductId()
Specified by:
getProductId in interface BasketIf
Returns:
Returns the productId.

setProductId

public void setProductId(int productId)
Specified by:
setProductId in interface BasketIf
Parameters:
productId - The productId to set.

getQuantity

public int getQuantity()
Specified by:
getQuantity in interface BasketIf
Returns:
Returns the quantity.

setQuantity

public void setQuantity(int quantity)
Specified by:
setQuantity in interface BasketIf
Parameters:
quantity - The quantity to set.

getFinalPriceExTax

public java.math.BigDecimal getFinalPriceExTax()
Description copied from interface: BasketIf
This is the price without including tax.

Specified by:
getFinalPriceExTax in interface BasketIf
Returns:
Returns the finalPriceExTax.

setFinalPriceExTax

public void setFinalPriceExTax(java.math.BigDecimal finalPriceExTax)
Description copied from interface: BasketIf
This is the price without including tax.

Specified by:
setFinalPriceExTax in interface BasketIf
Parameters:
finalPriceExTax - The finalPriceExTax to set.

getFinalPriceIncTax

public java.math.BigDecimal getFinalPriceIncTax()
Description copied from interface: BasketIf
This is the price including tax.

Specified by:
getFinalPriceIncTax in interface BasketIf
Returns:
Returns the finalPriceIncTax.

setFinalPriceIncTax

public void setFinalPriceIncTax(java.math.BigDecimal finalPriceIncTax)
Description copied from interface: BasketIf
This is the price including tax.

Specified by:
setFinalPriceIncTax in interface BasketIf
Parameters:
finalPriceIncTax - The finalPriceIncTax to set.

getQuantityInStock

public int getQuantityInStock()
Specified by:
getQuantityInStock in interface BasketIf
Returns:
Returns the quantityInStock.

setQuantityInStock

public void setQuantityInStock(int quantityInStock)
Specified by:
setQuantityInStock in interface BasketIf
Parameters:
quantityInStock - The quantityInStock to set.

getCustom1

public java.lang.String getCustom1()
Specified by:
getCustom1 in interface BasketIf
Returns:
Returns the custom1.

setCustom1

public void setCustom1(java.lang.String custom1)
Specified by:
setCustom1 in interface BasketIf
Parameters:
custom1 - The custom1 to set.

getCustom2

public java.lang.String getCustom2()
Specified by:
getCustom2 in interface BasketIf
Returns:
Returns the custom2.

setCustom2

public void setCustom2(java.lang.String custom2)
Specified by:
setCustom2 in interface BasketIf
Parameters:
custom2 - The custom2 to set.

getCustom3

public java.lang.String getCustom3()
Specified by:
getCustom3 in interface BasketIf
Returns:
Returns the custom3.

setCustom3

public void setCustom3(java.lang.String custom3)
Specified by:
setCustom3 in interface BasketIf
Parameters:
custom3 - The custom3 to set.

getCustom4

public java.lang.String getCustom4()
Specified by:
getCustom4 in interface BasketIf
Returns:
Returns the custom4.

setCustom4

public void setCustom4(java.lang.String custom4)
Specified by:
setCustom4 in interface BasketIf
Parameters:
custom4 - The custom4 to set.

getCustom5

public java.lang.String getCustom5()
Specified by:
getCustom5 in interface BasketIf
Returns:
Returns the custom5.

setCustom5

public void setCustom5(java.lang.String custom5)
Specified by:
setCustom5 in interface BasketIf
Parameters:
custom5 - The custom5 to set.

getDateAvailable

public java.util.Calendar getDateAvailable()
Description copied from interface: BasketIf
The date when the product will become available

Specified by:
getDateAvailable in interface BasketIf
Returns:
the dateAvailable

setDateAvailable

public void setDateAvailable(java.util.Calendar dateAvailable)
Description copied from interface: BasketIf
The date when the product will become available

Specified by:
setDateAvailable in interface BasketIf
Parameters:
dateAvailable - the dateAvailable to set

getSku

public java.lang.String getSku()
Description copied from interface: BasketIf
The SKU of the product

Specified by:
getSku in interface BasketIf
Returns:
the sku

setSku

public void setSku(java.lang.String sku)
Description copied from interface: BasketIf
The SKU of the product

Specified by:
setSku in interface BasketIf
Parameters:
sku - the sku to set

getWishListId

public int getWishListId()
Description copied from interface: BasketIf
Set to the id of the wish list (gift registry) to keep track that it has been added from a gift registry.

Specified by:
getWishListId in interface BasketIf
Returns:
the wishListId

setWishListId

public void setWishListId(int wishListId)
Description copied from interface: BasketIf
Set to the id of the wish list (gift registry) to keep track that it has been added from a gift registry.

Specified by:
setWishListId in interface BasketIf
Parameters:
wishListId - the wishListId to set

getWishListItemId

public int getWishListItemId()
Description copied from interface: BasketIf
Set to the id of the wish list item (gift registry item) to keep track that it has been added from a gift registry and which item it corresponds to.

Specified by:
getWishListItemId in interface BasketIf
Returns:
the wishListItemId

setWishListItemId

public void setWishListItemId(int wishListItemId)
Description copied from interface: BasketIf
Set to the id of the wish list item (gift registry item) to keep track that it has been added from a gift registry and which item it corresponds to.

Specified by:
setWishListItemId in interface BasketIf
Parameters:
wishListItemId - the wishListItemId to set

isUseBasketPrice

public boolean isUseBasketPrice()
Description copied from interface: BasketIf
When set, the price of the basket object is used rather than getting the price from the product object.

Specified by:
isUseBasketPrice in interface BasketIf
Returns:
the useBasketPrice

setUseBasketPrice

public void setUseBasketPrice(boolean useBasketPrice)
Description copied from interface: BasketIf
When set, the price of the basket object is used rather than getting the price from the product object.

Specified by:
setUseBasketPrice in interface BasketIf
Parameters:
useBasketPrice - the useBasketPrice to set


Copyright © 2011 DS Data Systems UK Ltd.