com.tootsville
Class Coupon

java.lang.Object
  extended by org.starhope.appius.sql.SQLPeerDatum
      extended by com.tootsville.Coupon
All Implemented Interfaces:
Serializable, Comparable<Object>

public class Coupon
extends SQLPeerDatum

TODO: The documentation for this type (Coupon) is incomplete. (twheys@gmail.com, Nov 3, 2009) XXX: I have no idea what this used to do and I'm removing it for now. XXX: Find out what this does and fix it.

Author:
twheys@gmail.com
See Also:
Serialized Form

Field Summary
private  BigDecimal couponAmount
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) couponAmount (Coupon)
private  String couponCode
          WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) couponCode (Coupon)
private  String couponDescription
          WRITEME FIXME: getText
private  int couponID
          The coupon's unique ID value
private  BigDecimal couponMinAmount
          The minimum amount for the coupon to WTF? WRITEME
private  String couponName
          The label for this coupon
private  Date endDate
          The expiry date of this coupon.
private static long serialVersionUID
          WRITEME: document this field (twheys@gmail.com, Oct 28, 2009) serialVersionUID (long)
private  Date startDate
          The date at which this coupon becomes effective
private  int usesPerCoupon
          The number of times for which this coupon may be used
private  int usesPerUser
          The number of times for which one user may use this coupon
 
Constructor Summary
Coupon(String userName)
           
 
Method Summary
 void flush()
          This is an overriding method.
private static String generateRandomCode()
          WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)
protected  String getCacheUniqueID()
          This is an overriding method.
 BigDecimal getCouponAmount()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 String getCouponCode()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 String getCouponDescription()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 int getCouponID()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 BigDecimal getCouponMinAmount()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 String getCouponName()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 Date getEndDate()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 Date getStartDate()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 int getUsesPerCoupon()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 int getUsesPerUser()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
private  void insertCoupon()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
private  void insertCouponDescription()
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void sendCouponCode(AbstractPerson user)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
protected  void set(ResultSet rs)
          This is an overriding method.
 void setCouponAmount(BigDecimal newCouponAmount)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void setCouponCode(String newCouponCode)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void setCouponID(int newCouponID)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void setCouponMinAmount(BigDecimal newCouponMinAmount)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void setCouponName(String newCouponName)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void setEndDate(Date newEndDate)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void setStartDate(Date newStartDate)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void setUsesPerCoupon(int newUsesPerCoupon)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 void setUsesPerUser(int newUsesPerUser)
          WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)
 String toString()
          This is an overriding method.
 
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum
changed, compareTo, findInCache, saveInCache, set, toJSON
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
WRITEME: document this field (twheys@gmail.com, Oct 28, 2009) serialVersionUID (long)

See Also:
Constant Field Values

couponAmount

private BigDecimal couponAmount
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) couponAmount (Coupon)


couponCode

private String couponCode
WRITEME: document this field (twheys@gmail.com, Nov 3, 2009) couponCode (Coupon)


couponDescription

private String couponDescription
WRITEME FIXME: getText


couponID

private int couponID
The coupon's unique ID value


couponMinAmount

private BigDecimal couponMinAmount
The minimum amount for the coupon to WTF? WRITEME


couponName

private String couponName
The label for this coupon


endDate

private Date endDate
The expiry date of this coupon.


startDate

private Date startDate
The date at which this coupon becomes effective


usesPerCoupon

private int usesPerCoupon
The number of times for which this coupon may be used


usesPerUser

private int usesPerUser
The number of times for which one user may use this coupon

Constructor Detail

Coupon

public Coupon(String userName)
Parameters:
userName - The debug name (user name plus user ID number) of the user for whom the coupon is being created
Method Detail

generateRandomCode

private static String generateRandomCode()
WRITEME: document this method (twheys@gmail.com, Sep 29, 2009)

Returns:
WRITEME

flush

public void flush()
This is an overriding method.

Specified by:
flush in class SQLPeerDatum
See Also:
SQLPeerDatum.flush()

getCacheUniqueID

protected String getCacheUniqueID()
This is an overriding method.

Specified by:
getCacheUniqueID in class SQLPeerDatum
Returns:
The local (Stringified) version of an unique ID; usually the database ID column
See Also:
SQLPeerDatum.getCacheUniqueID()

getCouponAmount

public BigDecimal getCouponAmount()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getCouponCode

public String getCouponCode()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getCouponDescription

public String getCouponDescription()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getCouponID

public int getCouponID()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getCouponMinAmount

public BigDecimal getCouponMinAmount()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getCouponName

public String getCouponName()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getEndDate

public Date getEndDate()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getStartDate

public Date getStartDate()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getUsesPerCoupon

public int getUsesPerCoupon()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

getUsesPerUser

public int getUsesPerUser()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Returns:
TODO

insertCoupon

private void insertCoupon()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)


insertCouponDescription

private void insertCouponDescription()
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)


sendCouponCode

public void sendCouponCode(AbstractPerson user)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
user - TODO

set

protected void set(ResultSet rs)
            throws SQLException
This is an overriding method.

Specified by:
set in class SQLPeerDatum
Parameters:
rs - The result of an SQL query, with the cursor already pointed at the row describing this specific instance of the object.
Throws:
SQLException - if the database fails somehow
See Also:
SQLPeerDatum.set(java.sql.ResultSet)

setCouponAmount

public void setCouponAmount(BigDecimal newCouponAmount)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newCouponAmount - TODO

setCouponCode

public void setCouponCode(String newCouponCode)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newCouponCode - TODO

setCouponID

public void setCouponID(int newCouponID)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newCouponID - TODO

setCouponMinAmount

public void setCouponMinAmount(BigDecimal newCouponMinAmount)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newCouponMinAmount - TODO

setCouponName

public void setCouponName(String newCouponName)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newCouponName - TODO

setEndDate

public void setEndDate(Date newEndDate)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newEndDate - TODO

setStartDate

public void setStartDate(Date newStartDate)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newStartDate - TODO

setUsesPerCoupon

public void setUsesPerCoupon(int newUsesPerCoupon)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newUsesPerCoupon - TODO

setUsesPerUser

public void setUsesPerUser(int newUsesPerUser)
WRITEME: document this method (twheys@gmail.com, Nov 3, 2009)

Parameters:
newUsesPerUser - TODO

toString

public String toString()
This is an overriding method.

Overrides:
toString in class Object
See Also:
Object.toString()