KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xpetstore > domain > CreditCard


1 /*
2  * Created on Feb 22, 2003
3  *
4  * To change this generated comment go to
5  * Window>Preferences>Java>Code Generation>Code Template
6  */

7 package xpetstore.domain;
8
9 import java.io.Serializable JavaDoc;
10
11
12 /**
13  * @author <a HREF="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
14  */

15 public class CreditCard
16     implements Serializable JavaDoc
17 {
18     //~ Static fields/initializers ---------------------------------------------
19

20     public static final String JavaDoc VISA = "Visa";
21     public static final String JavaDoc MASTERCARD = "MasterCard";
22     public static final String JavaDoc AMEX = "American Express";
23
24     //~ Instance fields --------------------------------------------------------
25

26     private String JavaDoc _number = "";
27     private String JavaDoc _type = "";
28     private String JavaDoc _expiryDate = "";
29
30     //~ Constructors -----------------------------------------------------------
31

32     public CreditCard( )
33     {
34         super( );
35     }
36
37     public CreditCard( CreditCard cc )
38     {
39         set( cc );
40     }
41
42     //~ Methods ----------------------------------------------------------------
43

44     /**
45      * @return String
46      *
47      * @hibernate.property
48      * column="creditCardExpiryDate"
49      * length="10"
50      */

51     public String JavaDoc getExpiryDate( )
52     {
53         return _expiryDate;
54     }
55
56     /**
57      * @return String
58      *
59      * @hibernate.property
60      * column="creditCardNumber"
61      * length="25"
62      */

63     public String JavaDoc getNumber( )
64     {
65         return _number;
66     }
67
68     /**
69      * @return String
70      *
71      * @hibernate.property
72      * column="creditCardType"
73      * length="25"
74      */

75     public String JavaDoc getType( )
76     {
77         return _type;
78     }
79
80     public void set( CreditCard cc )
81     {
82         _type = cc.getType( );
83         _number = cc.getNumber( );
84         _expiryDate = cc.getExpiryDate( );
85     }
86
87     /**
88      * Sets the expiryDate.
89      * @param expiryDate The expiryDate to set
90      */

91     public void setExpiryDate( String JavaDoc expiryDate )
92     {
93         _expiryDate = expiryDate;
94     }
95
96     /**
97      * Sets the number.
98      * @param number The number to set
99      */

100     public void setNumber( String JavaDoc number )
101     {
102         _number = number;
103     }
104
105     /**
106      * Sets the type.
107      * @param type The type to set
108      */

109     public void setType( String JavaDoc type )
110     {
111         _type = type;
112     }
113 }
114
Popular Tags