1 /*
2 * Copyright 2010-2026 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.mybatis.jpetstore.domain;
17
18 import java.io.Serializable;
19 import java.math.BigDecimal;
20
21 /**
22 * The Class Item.
23 *
24 * @author Eduardo Macarron
25 */
26 public class Item implements Serializable {
27
28 /** The serial version uid. */
29 private static final long serialVersionUID = -2159121673445254631L;
30
31 /** The item id. */
32 private String itemId;
33 /** The list price. */
34 private BigDecimal listPrice;
35 /** The unit cost. */
36 private BigDecimal unitCost;
37 /** The supplier id. */
38 private int supplierId;
39 /** The status. */
40 private String status;
41 /** The attribute1. */
42 private String attribute1;
43 /** The attribute2. */
44 private String attribute2;
45 /** The attribute3. */
46 private String attribute3;
47 /** The attribute4. */
48 private String attribute4;
49 /** The attribute5. */
50 private String attribute5;
51 /** The product. */
52 private Product product;
53 /** The quantity. */
54 private int quantity;
55
56 /**
57 * Gets the item id.
58 *
59 * @return the item id
60 */
61 public String getItemId() {
62 return itemId;
63 }
64
65 /**
66 * Sets the item id.
67 *
68 * @param itemId
69 * the item id
70 */
71 public void setItemId(String itemId) {
72 this.itemId = itemId.trim();
73 }
74
75 /**
76 * Gets the quantity.
77 *
78 * @return the quantity
79 */
80 public int getQuantity() {
81 return quantity;
82 }
83
84 /**
85 * Sets the quantity.
86 *
87 * @param quantity
88 * the quantity
89 */
90 public void setQuantity(int quantity) {
91 this.quantity = quantity;
92 }
93
94 /**
95 * Gets the product.
96 *
97 * @return the product
98 */
99 public Product getProduct() {
100 return product;
101 }
102
103 /**
104 * Sets the product.
105 *
106 * @param product
107 * the product
108 */
109 public void setProduct(Product product) {
110 this.product = product;
111 }
112
113 /**
114 * Gets the supplier id.
115 *
116 * @return the supplier id
117 */
118 public int getSupplierId() {
119 return supplierId;
120 }
121
122 /**
123 * Sets the supplier id.
124 *
125 * @param supplierId
126 * the supplier id
127 */
128 public void setSupplierId(int supplierId) {
129 this.supplierId = supplierId;
130 }
131
132 /**
133 * Gets the list price.
134 *
135 * @return the list price
136 */
137 public BigDecimal getListPrice() {
138 return listPrice;
139 }
140
141 /**
142 * Sets the list price.
143 *
144 * @param listPrice
145 * the list price
146 */
147 public void setListPrice(BigDecimal listPrice) {
148 this.listPrice = listPrice;
149 }
150
151 /**
152 * Gets the unit cost.
153 *
154 * @return the unit cost
155 */
156 public BigDecimal getUnitCost() {
157 return unitCost;
158 }
159
160 /**
161 * Sets the unit cost.
162 *
163 * @param unitCost
164 * the unit cost
165 */
166 public void setUnitCost(BigDecimal unitCost) {
167 this.unitCost = unitCost;
168 }
169
170 /**
171 * Gets the status.
172 *
173 * @return the status
174 */
175 public String getStatus() {
176 return status;
177 }
178
179 /**
180 * Sets the status.
181 *
182 * @param status
183 * the status
184 */
185 public void setStatus(String status) {
186 this.status = status;
187 }
188
189 /**
190 * Gets the attribute1.
191 *
192 * @return the attribute1
193 */
194 public String getAttribute1() {
195 return attribute1;
196 }
197
198 /**
199 * Sets the attribute1.
200 *
201 * @param attribute1
202 * the attribute1
203 */
204 public void setAttribute1(String attribute1) {
205 this.attribute1 = attribute1;
206 }
207
208 /**
209 * Gets the attribute2.
210 *
211 * @return the attribute2
212 */
213 public String getAttribute2() {
214 return attribute2;
215 }
216
217 /**
218 * Sets the attribute2.
219 *
220 * @param attribute2
221 * the attribute2
222 */
223 public void setAttribute2(String attribute2) {
224 this.attribute2 = attribute2;
225 }
226
227 /**
228 * Gets the attribute3.
229 *
230 * @return the attribute3
231 */
232 public String getAttribute3() {
233 return attribute3;
234 }
235
236 /**
237 * Sets the attribute3.
238 *
239 * @param attribute3
240 * the attribute3
241 */
242 public void setAttribute3(String attribute3) {
243 this.attribute3 = attribute3;
244 }
245
246 /**
247 * Gets the attribute4.
248 *
249 * @return the attribute4
250 */
251 public String getAttribute4() {
252 return attribute4;
253 }
254
255 /**
256 * Sets the attribute4.
257 *
258 * @param attribute4
259 * the attribute4
260 */
261 public void setAttribute4(String attribute4) {
262 this.attribute4 = attribute4;
263 }
264
265 /**
266 * Gets the attribute5.
267 *
268 * @return the attribute5
269 */
270 public String getAttribute5() {
271 return attribute5;
272 }
273
274 /**
275 * Sets the attribute5.
276 *
277 * @param attribute5
278 * the attribute5
279 */
280 public void setAttribute5(String attribute5) {
281 this.attribute5 = attribute5;
282 }
283
284 @Override
285 public String toString() {
286 return "(" + getItemId() + "-" + getProduct().getProductId() + ")";
287 }
288
289 }