com.konakart.app
Class Promotion

java.lang.Object
  extended by com.konakart.app.Promotion
All Implemented Interfaces:
PromotionIf

public class Promotion
extends java.lang.Object
implements PromotionIf

This is the Promotion class - it contains information about the promotion; links it to the Order Total module that is used to calculate the promotion, and identifies to what products and customers the promotion applies.


Constructor Summary
Promotion()
          Constructor
Promotion(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the Promotion object from a Record object
 
Method Summary
 OrderProductIf[] getApplicableProducts()
          Contains an array of OrderProduct objects to which the promotion can be applied.
 int getCategoryRule()
          This is the rule linking categories to the promotion.
 CouponIf getCoupon()
          There may be a coupon associated with the promotion.
 java.lang.String getCustom1()
           
 java.lang.String getCustom10()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 java.lang.String getCustom4()
           
 java.lang.String getCustom5()
           
 java.lang.String getCustom6()
           
 java.lang.String getCustom7()
           
 java.lang.String getCustom8()
           
 java.lang.String getCustom9()
           
 int getCustomerGroupRule()
          This is the rule linking customer groups to the promotion.
 int getCustomerRule()
          This is the rule linking customers to the promotion.
 java.util.Calendar getDateAdded()
           
 java.lang.String getDescription()
          A description of the promotion.
 java.util.Calendar getEndDate()
          After this date the promotion is no longer active.
 int getId()
           
 java.util.Calendar getLastModified()
           
 int getManufacturerRule()
          This is the rule linking manufacturers to the promotion.
 int getMaxUse()
          The maximum number of times that the promotion can be used by a single customer
 java.lang.String getName()
          The promotion name.
 java.lang.String getOrderTotalCode()
          The code of the order total module used to calculate the promotion.
 int getProductRule()
          This is the rule linking products to the promotion.
 java.util.Calendar getStartDate()
          Before this date the promotion is not active.
 boolean isActive()
          Set to true if the promotion is active.
 boolean isCumulative()
          Set to true if the promotion is cumulative with other promotions.
 boolean isRequiresCoupon()
          Does the promotion require a coupon
 void setActive(boolean active)
          Set to true if the promotion is active.
 void setApplicableProducts(OrderProductIf[] applicableProducts)
          Contains an array of OrderProduct objects to which the promotion can be applied.
 void setCategoryRule(int categoryRule)
          This is the rule linking categories to the promotion.
 void setCoupon(CouponIf coupon)
          There may be a coupon associated with the promotion.
 void setCumulative(boolean cumulative)
          Set to true if the promotion is cumulative with other promotions.
 void setCustom1(java.lang.String custom1)
           
 void setCustom10(java.lang.String custom10)
           
 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 setCustom6(java.lang.String custom6)
           
 void setCustom7(java.lang.String custom7)
           
 void setCustom8(java.lang.String custom8)
           
 void setCustom9(java.lang.String custom9)
           
 void setCustomerGroupRule(int customerGroupRule)
          This is the rule linking customer groups to the promotion.
 void setCustomerRule(int customerRule)
          This is the rule linking customers to the promotion.
 void setDateAdded(java.util.Calendar dateAdded)
           
 void setDescription(java.lang.String description)
          A description of the promotion.
 void setEndDate(java.util.Calendar endDate)
          After this date the promotion is no longer active.
 void setId(int id)
           
 void setLastModified(java.util.Calendar lastModified)
           
 void setManufacturerRule(int manufacturerRule)
          This is the rule linking manufacturers to the promotion.
 void setMaxUse(int maxUse)
          The maximum number of times that the promotion can be used by a single customer
 void setName(java.lang.String name)
          The promotion name.
 void setOrderTotalCode(java.lang.String orderTotalCode)
          The code of the order total module used to calculate the promotion.
 void setProductRule(int productRule)
          This is the rule linking products to the promotion.
 void setRequiresCoupon(boolean requiresCoupon)
          Does the promotion require a coupon
 void setStartDate(java.util.Calendar startDate)
          Before this date the promotion is not active.
 java.lang.String toString()
           
 java.lang.String toStringBrief()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Promotion

public Promotion()
Constructor


Promotion

public Promotion(com.workingdogs.village.Record vr,
                 org.apache.torque.util.Criteria c)
          throws com.workingdogs.village.DataSetException
Instantiates the attributes of the Promotion 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 Promotion object.

toStringBrief

public java.lang.String toStringBrief()
Returns:
Returns a string containing the attributes of the Promotion object.

isActive

public boolean isActive()
Description copied from interface: PromotionIf
Set to true if the promotion is active.

Specified by:
isActive in interface PromotionIf
Returns:
Returns the status of the object. The start and end dates are also used to determine whether the promotion is active.

setActive

public void setActive(boolean active)
Description copied from interface: PromotionIf
Set to true if the promotion is active.

Specified by:
setActive in interface PromotionIf
Parameters:
active - The active to set.

isCumulative

public boolean isCumulative()
Description copied from interface: PromotionIf
Set to true if the promotion is cumulative with other promotions. If it isn't cumulative but more than one promotion could apply to the order, then the promotion giving the maximum discount is used.

Specified by:
isCumulative in interface PromotionIf
Returns:
Returns the cumulative.

setCumulative

public void setCumulative(boolean cumulative)
Description copied from interface: PromotionIf
Set to true if the promotion is cumulative with other promotions. If it isn't cumulative but more than one promotion could apply to the order, then the promotion giving the maximum discount is used.

Specified by:
setCumulative in interface PromotionIf
Parameters:
cumulative - The cumulative to set.

getCustom1

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

setCustom1

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

getCustom2

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

setCustom2

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

getCustom3

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

setCustom3

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

getCustom4

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

setCustom4

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

getCustom5

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

setCustom5

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

getCustom6

public java.lang.String getCustom6()
Specified by:
getCustom6 in interface PromotionIf
Returns:
Returns the custom6.

setCustom6

public void setCustom6(java.lang.String custom6)
Specified by:
setCustom6 in interface PromotionIf
Parameters:
custom6 - The custom6 to set.

getCustom7

public java.lang.String getCustom7()
Specified by:
getCustom7 in interface PromotionIf
Returns:
Returns the custom7.

setCustom7

public void setCustom7(java.lang.String custom7)
Specified by:
setCustom7 in interface PromotionIf
Parameters:
custom7 - The custom7 to set.

getCustom8

public java.lang.String getCustom8()
Specified by:
getCustom8 in interface PromotionIf
Returns:
Returns the custom8.

setCustom8

public void setCustom8(java.lang.String custom8)
Specified by:
setCustom8 in interface PromotionIf
Parameters:
custom8 - The custom8 to set.

getCustom9

public java.lang.String getCustom9()
Specified by:
getCustom9 in interface PromotionIf
Returns:
Returns the custom9.

setCustom9

public void setCustom9(java.lang.String custom9)
Specified by:
setCustom9 in interface PromotionIf
Parameters:
custom9 - The custom9 to set.

getCustom10

public java.lang.String getCustom10()
Specified by:
getCustom10 in interface PromotionIf
Returns:
Returns the custom10.

setCustom10

public void setCustom10(java.lang.String custom10)
Specified by:
setCustom10 in interface PromotionIf
Parameters:
custom10 - The custom10 to set.

getId

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

setId

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

getOrderTotalCode

public java.lang.String getOrderTotalCode()
Description copied from interface: PromotionIf
The code of the order total module used to calculate the promotion.

Specified by:
getOrderTotalCode in interface PromotionIf
Returns:
Returns the orderTotalCode.

setOrderTotalCode

public void setOrderTotalCode(java.lang.String orderTotalCode)
Description copied from interface: PromotionIf
The code of the order total module used to calculate the promotion.

Specified by:
setOrderTotalCode in interface PromotionIf
Parameters:
orderTotalCode - The orderTotalCode to set.

getName

public java.lang.String getName()
Description copied from interface: PromotionIf
The promotion name.

Specified by:
getName in interface PromotionIf
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Description copied from interface: PromotionIf
The promotion name.

Specified by:
setName in interface PromotionIf
Parameters:
name - The name to set.

getDescription

public java.lang.String getDescription()
Description copied from interface: PromotionIf
A description of the promotion.

Specified by:
getDescription in interface PromotionIf
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: PromotionIf
A description of the promotion.

Specified by:
setDescription in interface PromotionIf
Parameters:
description - The description to set.

isRequiresCoupon

public boolean isRequiresCoupon()
Description copied from interface: PromotionIf
Does the promotion require a coupon

Specified by:
isRequiresCoupon in interface PromotionIf
Returns:
Returns the requiresCoupon.

setRequiresCoupon

public void setRequiresCoupon(boolean requiresCoupon)
Description copied from interface: PromotionIf
Does the promotion require a coupon

Specified by:
setRequiresCoupon in interface PromotionIf
Parameters:
requiresCoupon - The requiresCoupon to set.

getCategoryRule

public int getCategoryRule()
Description copied from interface: PromotionIf
This is the rule linking categories to the promotion. Valid values are:

Specified by:
getCategoryRule in interface PromotionIf
Returns:
Returns the categoryRule.

setCategoryRule

public void setCategoryRule(int categoryRule)
Description copied from interface: PromotionIf
This is the rule linking categories to the promotion. Valid values are:

Specified by:
setCategoryRule in interface PromotionIf
Parameters:
categoryRule - The categoryRule to set.

getCustomerRule

public int getCustomerRule()
Description copied from interface: PromotionIf
This is the rule linking customers to the promotion. Valid values are:

Specified by:
getCustomerRule in interface PromotionIf
Returns:
Returns the customerRule.

setCustomerRule

public void setCustomerRule(int customerRule)
Description copied from interface: PromotionIf
This is the rule linking customers to the promotion. Valid values are:

Specified by:
setCustomerRule in interface PromotionIf
Parameters:
customerRule - The customerRule to set.

getManufacturerRule

public int getManufacturerRule()
Description copied from interface: PromotionIf
This is the rule linking manufacturers to the promotion. Valid values are:

Specified by:
getManufacturerRule in interface PromotionIf
Returns:
Returns the manufacturerRule.

setManufacturerRule

public void setManufacturerRule(int manufacturerRule)
Description copied from interface: PromotionIf
This is the rule linking manufacturers to the promotion. Valid values are:

Specified by:
setManufacturerRule in interface PromotionIf
Parameters:
manufacturerRule - The manufacturerRule to set.

getProductRule

public int getProductRule()
Description copied from interface: PromotionIf
This is the rule linking products to the promotion. Valid values are:

Specified by:
getProductRule in interface PromotionIf
Returns:
Returns the productRule.

setProductRule

public void setProductRule(int productRule)
Description copied from interface: PromotionIf
This is the rule linking products to the promotion. Valid values are:

Specified by:
setProductRule in interface PromotionIf
Parameters:
productRule - The productRule to set.

getApplicableProducts

public OrderProductIf[] getApplicableProducts()
Description copied from interface: PromotionIf
Contains an array of OrderProduct objects to which the promotion can be applied.

Specified by:
getApplicableProducts in interface PromotionIf
Returns:
Returns the applicableProducts.

setApplicableProducts

public void setApplicableProducts(OrderProductIf[] applicableProducts)
Description copied from interface: PromotionIf
Contains an array of OrderProduct objects to which the promotion can be applied.

Specified by:
setApplicableProducts in interface PromotionIf
Parameters:
applicableProducts - The applicableProducts to set.

getDateAdded

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

setDateAdded

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

getEndDate

public java.util.Calendar getEndDate()
Description copied from interface: PromotionIf
After this date the promotion is no longer active.

Specified by:
getEndDate in interface PromotionIf
Returns:
Returns the endDate.

setEndDate

public void setEndDate(java.util.Calendar endDate)
Description copied from interface: PromotionIf
After this date the promotion is no longer active.

Specified by:
setEndDate in interface PromotionIf
Parameters:
endDate - The endDate to set.

getLastModified

public java.util.Calendar getLastModified()
Specified by:
getLastModified in interface PromotionIf
Returns:
Returns the lastModified.

setLastModified

public void setLastModified(java.util.Calendar lastModified)
Specified by:
setLastModified in interface PromotionIf
Parameters:
lastModified - The lastModified to set.

getStartDate

public java.util.Calendar getStartDate()
Description copied from interface: PromotionIf
Before this date the promotion is not active.

Specified by:
getStartDate in interface PromotionIf
Returns:
Returns the startDate.

setStartDate

public void setStartDate(java.util.Calendar startDate)
Description copied from interface: PromotionIf
Before this date the promotion is not active.

Specified by:
setStartDate in interface PromotionIf
Parameters:
startDate - The startDate to set.

getCoupon

public CouponIf getCoupon()
Description copied from interface: PromotionIf
There may be a coupon associated with the promotion.

Specified by:
getCoupon in interface PromotionIf
Returns:
Returns the coupon.

setCoupon

public void setCoupon(CouponIf coupon)
Description copied from interface: PromotionIf
There may be a coupon associated with the promotion.

Specified by:
setCoupon in interface PromotionIf
Parameters:
coupon - The coupon to set.

getCustomerGroupRule

public int getCustomerGroupRule()
Description copied from interface: PromotionIf
This is the rule linking customer groups to the promotion. Valid values are:

Specified by:
getCustomerGroupRule in interface PromotionIf
Returns:
Returns the customerGroupRule.

setCustomerGroupRule

public void setCustomerGroupRule(int customerGroupRule)
Description copied from interface: PromotionIf
This is the rule linking customer groups to the promotion. Valid values are:

Specified by:
setCustomerGroupRule in interface PromotionIf
Parameters:
customerGroupRule - The customerGroupRule to set.

getMaxUse

public int getMaxUse()
Description copied from interface: PromotionIf
The maximum number of times that the promotion can be used by a single customer

Specified by:
getMaxUse in interface PromotionIf
Returns:
the maxUse

setMaxUse

public void setMaxUse(int maxUse)
Description copied from interface: PromotionIf
The maximum number of times that the promotion can be used by a single customer

Specified by:
setMaxUse in interface PromotionIf
Parameters:
maxUse - the maxUse to set


Copyright © 2011 DS Data Systems UK Ltd.