KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > j2ee > blueprints > opc > purchaseorder > PurchaseOrder


1 /*
2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * - Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * - Redistribution in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Sun Microsystems, Inc. or the names of
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * This software is provided "AS IS," without a warranty of any
21 * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
25 * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
26 * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
27 * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
28 * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
29 * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
30 * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
31 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 *
33 * You acknowledge that Software is not designed, licensed or intended
34 * for use in the design, construction, operation or maintenance of
35 * any nuclear facility.
36 */

37
38 package com.sun.j2ee.blueprints.opc.purchaseorder;
39
40 import java.util.*;
41 import java.io.*;
42
43 /**
44  * This object is represents the purchase order
45  * that is persisted after a user places an order.
46  */

47 public class PurchaseOrder implements Serializable{
48
49   protected String JavaDoc poId;
50   protected String JavaDoc userId;
51   protected String JavaDoc emailId;
52   protected String JavaDoc locale;
53   protected Calendar orderDate;
54   protected ContactInfo shippingInfo;
55   protected ContactInfo billingInfo;
56   protected float totalPrice;
57   protected CreditCard creditCard;
58   protected int headCount;
59   protected Calendar startDate;
60   protected Calendar endDate;
61   protected String JavaDoc departureCity;
62   protected Activity[] activities;
63   protected Lodging lodging;
64   protected Transportation departureFlightInfo;
65   protected Transportation returnFlightInfo;
66
67   // Constructor
68
public PurchaseOrder() {}
69
70   public PurchaseOrder(String JavaDoc poId, String JavaDoc userId, String JavaDoc emailId,
71                        String JavaDoc locale, Calendar orderDate,
72                        ContactInfo shippingInfo, ContactInfo billingInfo,
73                        float totalPrice, CreditCard creditCard, int headCount,
74                        Calendar startDate, Calendar endDate, String JavaDoc departureCity,
75                        Activity[] activities, Lodging lodging,
76                        Transportation departureFlightInfo,
77                        Transportation returnFlightInfo) {
78     this.poId = poId;
79     this.shippingInfo = shippingInfo;
80     this.userId = userId;
81     this.emailId = emailId;
82     this.locale = locale;
83     this.orderDate = orderDate;
84     this.billingInfo = billingInfo;
85     this.totalPrice = totalPrice;
86     this.creditCard = creditCard;
87     this.headCount = headCount;
88     this.startDate = startDate;
89     this.endDate = endDate;
90     this.departureCity = departureCity;
91     this.activities = activities;
92     this.lodging = lodging;
93     this.departureFlightInfo = departureFlightInfo;
94     this.returnFlightInfo = returnFlightInfo;
95   }
96
97   // getter methods
98
public String JavaDoc getPoId() {
99     return poId;
100   }
101
102   public String JavaDoc getUserId() {
103     return userId;
104   }
105
106   public String JavaDoc getEmailId() {
107     return emailId;
108   }
109
110   public String JavaDoc getLocale() {
111     return locale;
112   }
113
114   public Calendar getOrderDate() {
115     return orderDate;
116   }
117
118   public ContactInfo getShippingInfo() {
119     return shippingInfo;
120   }
121
122   public ContactInfo getBillingInfo() {
123     return billingInfo;
124   }
125
126   public float getTotalPrice() {
127     return totalPrice;
128   }
129
130   public CreditCard getCreditCard() {
131     return creditCard;
132   }
133
134   public int getHeadCount() {
135     return headCount;
136   }
137
138   public Calendar getStartDate() {
139     return startDate;
140   }
141
142   public Calendar getEndDate() {
143     return endDate;
144   }
145
146   public String JavaDoc getDepartureCity() {
147     return departureCity;
148   }
149
150   public Activity[] getActivities() {
151     return activities;
152   }
153
154   public Lodging getLodging() {
155     return lodging;
156   }
157
158   public Transportation getDepartureFlightInfo() {
159     return departureFlightInfo;
160   }
161
162   public Transportation getReturnFlightInfo() {
163     return returnFlightInfo;
164   }
165
166   // setter methods
167
public void setPoId(String JavaDoc poId) {
168     this.poId = poId;
169   }
170
171   public void setUserId(String JavaDoc userId) {
172     this.userId = userId;
173   }
174
175   public void setEmailId(String JavaDoc emailId) {
176     this.emailId = emailId;
177   }
178
179   public void setLocale(String JavaDoc locale) {
180     this.locale = locale;
181   }
182
183   public void setOrderDate(Calendar orderDate) {
184     this.orderDate = orderDate;
185   }
186
187   public void setShippingInfo(ContactInfo shippingInfo) {
188     this.shippingInfo = shippingInfo;
189   }
190
191   public void setBillingInfo(ContactInfo billingInfo) {
192     this.billingInfo = billingInfo;
193   }
194
195   public void setTotalPrice(float totalPrice) {
196     this.totalPrice = totalPrice;
197   }
198
199   public void setCreditCard(CreditCard creditCard) {
200     this.creditCard = creditCard;
201   }
202
203   public void setHeadCount(int headCount) {
204     this.headCount = headCount;
205   }
206
207   public void setStartDate(Calendar startDate) {
208     this.startDate = startDate;
209   }
210
211   public void setEndDate(Calendar endDate) {
212     this.endDate = endDate;
213   }
214
215   public void setDepartureCity(String JavaDoc departureCity) {
216     this.departureCity = departureCity;
217   }
218
219   public void setActivities(Activity[] activity) {
220     this.activities = activity;
221   }
222
223   public void setLodging(Lodging lodging) {
224     this.lodging = lodging;
225   }
226
227   public void setDepartureFlightInfo(Transportation departureFlightInfo) {
228     this.departureFlightInfo = departureFlightInfo;
229   }
230
231   public void setReturnFlightInfo(Transportation returnFlightInfo) {
232     this.returnFlightInfo = returnFlightInfo;
233   }
234
235 }
236
Popular Tags