com.konakart.app
Class Coupon

java.lang.Object
  extended by com.konakart.app.Coupon
All Implemented Interfaces:
CouponIf

public class Coupon
extends java.lang.Object
implements CouponIf

The Coupon class contains information about the coupon which can be used to activate promotions on an order.


Constructor Summary
Coupon()
          Constructor
Coupon(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the Promotion object from a Record object
 
Method Summary
 java.lang.String getCouponCode()
          The code of the coupon is the string used by a customer to activate it.
 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.lang.String getDescription()
           
 int getId()
           
 java.util.Calendar getLastModified()
           
 int getMaxUse()
          The maximum number of times that a coupon may be used.
 java.lang.String getName()
           
 int getTimesUsed()
          The number of times that a coupon has been used.
 boolean isValid()
          Determines whether the coupon is valid based on the number of times that it has been used.
 void setCouponCode(java.lang.String couponCode)
          The code of the coupon is the string used by a customer to activate it.
 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 setDescription(java.lang.String description)
           
 void setId(int id)
           
 void setLastModified(java.util.Calendar lastModified)
           
 void setMaxUse(int maxUse)
          The maximum number of times that a coupon may be used.
 void setName(java.lang.String name)
           
 void setTimesUsed(int timesUsed)
          The number of times that a coupon has been used.
 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

Coupon

public Coupon()
Constructor


Coupon

public Coupon(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 Coupon object.

toStringBrief

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

isValid

public boolean isValid()
Determines whether the coupon is valid based on the number of times that it has been used. If maxUse is negative then the number of times used isn't controlled.

Returns:
Returns true if the coupon is valid

getCouponCode

public java.lang.String getCouponCode()
Description copied from interface: CouponIf
The code of the coupon is the string used by a customer to activate it.

Specified by:
getCouponCode in interface CouponIf
Returns:
Returns the couponCode.

setCouponCode

public void setCouponCode(java.lang.String couponCode)
Description copied from interface: CouponIf
The code of the coupon is the string used by a customer to activate it.

Specified by:
setCouponCode in interface CouponIf
Parameters:
couponCode - The couponCode to set.

getCustom1

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

setCustom1

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

getCustom2

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

setCustom2

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

getCustom3

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

setCustom3

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

getCustom4

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

setCustom4

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

getCustom5

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

setCustom5

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

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface CouponIf
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Specified by:
setDescription in interface CouponIf
Parameters:
description - The description to set.

getId

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

setId

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

getMaxUse

public int getMaxUse()
Description copied from interface: CouponIf
The maximum number of times that a coupon may be used. -1 indicates unlimited use.

Specified by:
getMaxUse in interface CouponIf
Returns:
Returns the maxUse.

setMaxUse

public void setMaxUse(int maxUse)
Description copied from interface: CouponIf
The maximum number of times that a coupon may be used. -1 indicates unlimited use.

Specified by:
setMaxUse in interface CouponIf
Parameters:
maxUse - The maxUse to set.

getName

public java.lang.String getName()
Specified by:
getName in interface CouponIf
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Specified by:
setName in interface CouponIf
Parameters:
name - The name to set.

getTimesUsed

public int getTimesUsed()
Description copied from interface: CouponIf
The number of times that a coupon has been used.

Specified by:
getTimesUsed in interface CouponIf
Returns:
Returns the timesUsed.

setTimesUsed

public void setTimesUsed(int timesUsed)
Description copied from interface: CouponIf
The number of times that a coupon has been used.

Specified by:
setTimesUsed in interface CouponIf
Parameters:
timesUsed - The timesUsed to set.

getDateAdded

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

setDateAdded

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

getLastModified

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

setLastModified

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


Copyright © 2011 DS Data Systems UK Ltd.