com.konakartadmin.app
Class AdminCoupon

java.lang.Object
  extended by com.konakartadmin.app.AdminCoupon
All Implemented Interfaces:
AdminObjectIf

public class AdminCoupon
extends java.lang.Object
implements AdminObjectIf

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


Field Summary
private  java.lang.String couponCode
          The value of the coupon code
private  java.lang.String custom1
          Custom fields
private  java.lang.String custom2
           
private  java.lang.String custom3
           
private  java.lang.String custom4
           
private  java.lang.String custom5
           
private  java.util.Date dateAdded
          The value for the dateAdded field
private  java.lang.String description
          Description
private  int id
          The value for the couponId field
private  java.util.Date lastModified
          The value for the lastModified field
private  int maxUse
          The maximum number of times that the coupon can be used
private  java.lang.String name
          Name
private  AdminPromotion[] promotions
          An array of promotions that the coupon is associated with
private  int timesUsed
          The number of times that the coupon has been used
 
Constructor Summary
AdminCoupon()
          Constructor
AdminCoupon(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()
           
 java.lang.String getCustom1()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 java.lang.String getCustom4()
           
 java.lang.String getCustom5()
           
 java.util.Date getDateAdded()
           
 java.lang.String getDescription()
           
 int getId()
           
 java.util.Date getLastModified()
           
 int getMaxUse()
           
 java.lang.String getName()
           
 AdminPromotion[] getPromotions()
           
 int getTimesUsed()
           
 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)
           
 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.Date dateAdded)
           
 void setDescription(java.lang.String description)
           
 void setId(int id)
           
 void setLastModified(java.util.Date lastModified)
           
 void setMaxUse(int maxUse)
           
 void setName(java.lang.String name)
           
 void setPromotions(AdminPromotion[] promotions)
           
 void setTimesUsed(int timesUsed)
           
 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
 

Field Detail

id

private int id
The value for the couponId field


description

private java.lang.String description
Description


name

private java.lang.String name
Name


couponCode

private java.lang.String couponCode
The value of the coupon code


maxUse

private int maxUse
The maximum number of times that the coupon can be used


timesUsed

private int timesUsed
The number of times that the coupon has been used


lastModified

private java.util.Date lastModified
The value for the lastModified field


dateAdded

private java.util.Date dateAdded
The value for the dateAdded field


custom1

private java.lang.String custom1
Custom fields


custom2

private java.lang.String custom2

custom3

private java.lang.String custom3

custom4

private java.lang.String custom4

custom5

private java.lang.String custom5

promotions

private AdminPromotion[] promotions
An array of promotions that the coupon is associated with

Constructor Detail

AdminCoupon

public AdminCoupon()
Constructor


AdminCoupon

public AdminCoupon(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()
Specified by:
toString in interface AdminObjectIf
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()
Returns:
Returns the couponCode.

setCouponCode

public void setCouponCode(java.lang.String couponCode)
Parameters:
couponCode - The couponCode to set.

getCustom1

public java.lang.String getCustom1()
Returns:
Returns the custom1.

setCustom1

public void setCustom1(java.lang.String custom1)
Parameters:
custom1 - The custom1 to set.

getCustom2

public java.lang.String getCustom2()
Returns:
Returns the custom2.

setCustom2

public void setCustom2(java.lang.String custom2)
Parameters:
custom2 - The custom2 to set.

getCustom3

public java.lang.String getCustom3()
Returns:
Returns the custom3.

setCustom3

public void setCustom3(java.lang.String custom3)
Parameters:
custom3 - The custom3 to set.

getCustom4

public java.lang.String getCustom4()
Returns:
Returns the custom4.

setCustom4

public void setCustom4(java.lang.String custom4)
Parameters:
custom4 - The custom4 to set.

getCustom5

public java.lang.String getCustom5()
Returns:
Returns the custom5.

setCustom5

public void setCustom5(java.lang.String custom5)
Parameters:
custom5 - The custom5 to set.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.

getId

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

setId

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

getMaxUse

public int getMaxUse()
Returns:
Returns the maxUse.

setMaxUse

public void setMaxUse(int maxUse)
Parameters:
maxUse - The maxUse to set.

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Parameters:
name - The name to set.

getTimesUsed

public int getTimesUsed()
Returns:
Returns the timesUsed.

setTimesUsed

public void setTimesUsed(int timesUsed)
Parameters:
timesUsed - The timesUsed to set.

getDateAdded

public java.util.Date getDateAdded()
Returns:
Returns the dateAdded.

setDateAdded

public void setDateAdded(java.util.Date dateAdded)
Parameters:
dateAdded - The dateAdded to set.

getLastModified

public java.util.Date getLastModified()
Returns:
Returns the lastModified.

setLastModified

public void setLastModified(java.util.Date lastModified)
Parameters:
lastModified - The lastModified to set.

getPromotions

public AdminPromotion[] getPromotions()
Returns:
Returns the promotions.

setPromotions

public void setPromotions(AdminPromotion[] promotions)
Parameters:
promotions - The promotions to set.


Copyright © 2011 DS Data Systems UK Ltd.