1 //---------------------------------------------------------------------- 2 // 3 // PerfectJPattern: "Design patterns are good but components are better!" 4 // Purchase.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 * Purchase Data model object 27 * 28 * @author <a href="mailto:bravegag@hotmail.com">Giovanni Azua</a> 29 * @version $ $Date: Dec 5, 2008 11:49:14 AM $ 30 */ 31 public 32 class Order 33 { 34 //------------------------------------------------------------------------ 35 // public 36 //------------------------------------------------------------------------ 37 public 38 Order() 39 { 40 // do nothing 41 } 42 43 //------------------------------------------------------------------------ 44 public 45 Order(Customer aCustomer, Date aDate, Set<Product> aProducts) 46 { 47 theCustomer = aCustomer; 48 theDate = aDate; 49 theProducts = aProducts; 50 } 51 52 //------------------------------------------------------------------------ 53 /** 54 * @return the id 55 */ 56 public Long 57 getId() 58 { 59 return theId; 60 } 61 62 //------------------------------------------------------------------------ 63 /** 64 * @param anId the id to set 65 */ 66 public void 67 setId(Long anId) 68 { 69 theId = anId; 70 } 71 72 //------------------------------------------------------------------------ 73 /** 74 * @return the date 75 */ 76 public Date 77 getDate() 78 { 79 return theDate; 80 } 81 82 //------------------------------------------------------------------------ 83 /** 84 * @param aDate the date to set 85 */ 86 public void 87 setDate(Date aDate) 88 { 89 theDate = aDate; 90 } 91 92 //------------------------------------------------------------------------ 93 /** 94 * @return the products 95 */ 96 public Set<Product> 97 getProducts() 98 { 99 return theProducts; 100 } 101 102 //------------------------------------------------------------------------ 103 /** 104 * @param aProducts the products to set 105 */ 106 public void 107 setProducts(Set<Product> aProducts) 108 { 109 theProducts = aProducts; 110 } 111 112 //------------------------------------------------------------------------ 113 /** 114 * @return the customer 115 */ 116 public Customer 117 getCustomer() 118 { 119 return theCustomer; 120 } 121 122 //------------------------------------------------------------------------ 123 /** 124 * @param anCustomer the customer to set 125 */ 126 public void 127 setCustomer(Customer anCustomer) 128 { 129 theCustomer = anCustomer; 130 } 131 132 //------------------------------------------------------------------------ 133 // members 134 //------------------------------------------------------------------------ 135 private Long theId; 136 private Date theDate; 137 private Customer theCustomer; 138 private Set<Product> theProducts; 139 }