1 //----------------------------------------------------------------------
2 //
3 // PerfectJPattern: "Design patterns are good but components are better!"
4 // Customer.java Copyright (c) 2009 Giovanni Azua Garcia
5 // bravegag@hotmail.com
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 3
10 // of the License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, see <http://www.gnu.org/licenses/>.
19 //
20 //----------------------------------------------------------------------
21 package org.perfectjpattern.example.datamodel;
22
23 import java.util.*;
24
25 /**
26 * Customer Data model object
27 *
28 * @author <a href="mailto:bravegag@hotmail.com">Giovanni Azua</a>
29 * @version $ $Date: Dec 5, 2008 2:59:04 AM $
30 */
31 public
32 class Customer
33 {
34 //------------------------------------------------------------------------
35 // public
36 //------------------------------------------------------------------------
37 public
38 Customer()
39 {
40 // do nothing
41 }
42
43 //------------------------------------------------------------------------
44 public
45 Customer(String aName)
46 {
47 theName = aName;
48 theOrders = new ArrayList<Order>();
49 }
50
51 //------------------------------------------------------------------------
52 /**
53 * Returns the id
54 *
55 * @return the id
56 */
57 public Long
58 getId()
59 {
60 return theId;
61 }
62
63 //------------------------------------------------------------------------
64 /**
65 * Sets the id of the person
66 *
67 * @param anId the id to set
68 */
69 public void
70 setId(Long anId)
71 {
72 theId = anId;
73 }
74
75 //------------------------------------------------------------------------
76 /**
77 * Returns the name
78 *
79 * @return the name
80 */
81 public String
82 getName()
83 {
84 return theName;
85 }
86
87 //------------------------------------------------------------------------
88 /**
89 * Sets the name of the person
90 *
91 * @param aName the name to set
92 */
93 public void
94 setName(String aName)
95 {
96 theName = aName;
97 }
98
99 //------------------------------------------------------------------------
100 /**
101 * Returns the orders
102 *
103 * @return the orders
104 */
105 public List<Order>
106 getOrders()
107 {
108 return theOrders;
109 }
110
111 //------------------------------------------------------------------------
112 /**
113 * Sets the orders
114 *
115 * @param anOrders the orders to set
116 */
117 public void
118 setOrders(List<Order> anOrders)
119 {
120 theOrders = anOrders;
121 }
122
123 //------------------------------------------------------------------------
124 // members
125 //------------------------------------------------------------------------
126 private Long theId;
127 private String theName;
128 private List<Order> theOrders;
129 }