001
014
015 package com.liferay.portlet.shopping.model;
016
017 import com.liferay.portal.kernel.util.Validator;
018 import com.liferay.portal.model.ModelWrapper;
019
020 import java.util.HashMap;
021 import java.util.Map;
022
023
032 public class ShoppingItemPriceWrapper implements ShoppingItemPrice,
033 ModelWrapper<ShoppingItemPrice> {
034 public ShoppingItemPriceWrapper(ShoppingItemPrice shoppingItemPrice) {
035 _shoppingItemPrice = shoppingItemPrice;
036 }
037
038 @Override
039 public Class<?> getModelClass() {
040 return ShoppingItemPrice.class;
041 }
042
043 @Override
044 public String getModelClassName() {
045 return ShoppingItemPrice.class.getName();
046 }
047
048 @Override
049 public Map<String, Object> getModelAttributes() {
050 Map<String, Object> attributes = new HashMap<String, Object>();
051
052 attributes.put("itemPriceId", getItemPriceId());
053 attributes.put("itemId", getItemId());
054 attributes.put("minQuantity", getMinQuantity());
055 attributes.put("maxQuantity", getMaxQuantity());
056 attributes.put("price", getPrice());
057 attributes.put("discount", getDiscount());
058 attributes.put("taxable", getTaxable());
059 attributes.put("shipping", getShipping());
060 attributes.put("useShippingFormula", getUseShippingFormula());
061 attributes.put("status", getStatus());
062
063 return attributes;
064 }
065
066 @Override
067 public void setModelAttributes(Map<String, Object> attributes) {
068 Long itemPriceId = (Long)attributes.get("itemPriceId");
069
070 if (itemPriceId != null) {
071 setItemPriceId(itemPriceId);
072 }
073
074 Long itemId = (Long)attributes.get("itemId");
075
076 if (itemId != null) {
077 setItemId(itemId);
078 }
079
080 Integer minQuantity = (Integer)attributes.get("minQuantity");
081
082 if (minQuantity != null) {
083 setMinQuantity(minQuantity);
084 }
085
086 Integer maxQuantity = (Integer)attributes.get("maxQuantity");
087
088 if (maxQuantity != null) {
089 setMaxQuantity(maxQuantity);
090 }
091
092 Double price = (Double)attributes.get("price");
093
094 if (price != null) {
095 setPrice(price);
096 }
097
098 Double discount = (Double)attributes.get("discount");
099
100 if (discount != null) {
101 setDiscount(discount);
102 }
103
104 Boolean taxable = (Boolean)attributes.get("taxable");
105
106 if (taxable != null) {
107 setTaxable(taxable);
108 }
109
110 Double shipping = (Double)attributes.get("shipping");
111
112 if (shipping != null) {
113 setShipping(shipping);
114 }
115
116 Boolean useShippingFormula = (Boolean)attributes.get(
117 "useShippingFormula");
118
119 if (useShippingFormula != null) {
120 setUseShippingFormula(useShippingFormula);
121 }
122
123 Integer status = (Integer)attributes.get("status");
124
125 if (status != null) {
126 setStatus(status);
127 }
128 }
129
130
135 @Override
136 public long getPrimaryKey() {
137 return _shoppingItemPrice.getPrimaryKey();
138 }
139
140
145 @Override
146 public void setPrimaryKey(long primaryKey) {
147 _shoppingItemPrice.setPrimaryKey(primaryKey);
148 }
149
150
155 @Override
156 public long getItemPriceId() {
157 return _shoppingItemPrice.getItemPriceId();
158 }
159
160
165 @Override
166 public void setItemPriceId(long itemPriceId) {
167 _shoppingItemPrice.setItemPriceId(itemPriceId);
168 }
169
170
175 @Override
176 public long getItemId() {
177 return _shoppingItemPrice.getItemId();
178 }
179
180
185 @Override
186 public void setItemId(long itemId) {
187 _shoppingItemPrice.setItemId(itemId);
188 }
189
190
195 @Override
196 public int getMinQuantity() {
197 return _shoppingItemPrice.getMinQuantity();
198 }
199
200
205 @Override
206 public void setMinQuantity(int minQuantity) {
207 _shoppingItemPrice.setMinQuantity(minQuantity);
208 }
209
210
215 @Override
216 public int getMaxQuantity() {
217 return _shoppingItemPrice.getMaxQuantity();
218 }
219
220
225 @Override
226 public void setMaxQuantity(int maxQuantity) {
227 _shoppingItemPrice.setMaxQuantity(maxQuantity);
228 }
229
230
235 @Override
236 public double getPrice() {
237 return _shoppingItemPrice.getPrice();
238 }
239
240
245 @Override
246 public void setPrice(double price) {
247 _shoppingItemPrice.setPrice(price);
248 }
249
250
255 @Override
256 public double getDiscount() {
257 return _shoppingItemPrice.getDiscount();
258 }
259
260
265 @Override
266 public void setDiscount(double discount) {
267 _shoppingItemPrice.setDiscount(discount);
268 }
269
270
275 @Override
276 public boolean getTaxable() {
277 return _shoppingItemPrice.getTaxable();
278 }
279
280
285 @Override
286 public boolean isTaxable() {
287 return _shoppingItemPrice.isTaxable();
288 }
289
290
295 @Override
296 public void setTaxable(boolean taxable) {
297 _shoppingItemPrice.setTaxable(taxable);
298 }
299
300
305 @Override
306 public double getShipping() {
307 return _shoppingItemPrice.getShipping();
308 }
309
310
315 @Override
316 public void setShipping(double shipping) {
317 _shoppingItemPrice.setShipping(shipping);
318 }
319
320
325 @Override
326 public boolean getUseShippingFormula() {
327 return _shoppingItemPrice.getUseShippingFormula();
328 }
329
330
335 @Override
336 public boolean isUseShippingFormula() {
337 return _shoppingItemPrice.isUseShippingFormula();
338 }
339
340
345 @Override
346 public void setUseShippingFormula(boolean useShippingFormula) {
347 _shoppingItemPrice.setUseShippingFormula(useShippingFormula);
348 }
349
350
355 @Override
356 public int getStatus() {
357 return _shoppingItemPrice.getStatus();
358 }
359
360
365 @Override
366 public void setStatus(int status) {
367 _shoppingItemPrice.setStatus(status);
368 }
369
370 @Override
371 public boolean isNew() {
372 return _shoppingItemPrice.isNew();
373 }
374
375 @Override
376 public void setNew(boolean n) {
377 _shoppingItemPrice.setNew(n);
378 }
379
380 @Override
381 public boolean isCachedModel() {
382 return _shoppingItemPrice.isCachedModel();
383 }
384
385 @Override
386 public void setCachedModel(boolean cachedModel) {
387 _shoppingItemPrice.setCachedModel(cachedModel);
388 }
389
390 @Override
391 public boolean isEscapedModel() {
392 return _shoppingItemPrice.isEscapedModel();
393 }
394
395 @Override
396 public java.io.Serializable getPrimaryKeyObj() {
397 return _shoppingItemPrice.getPrimaryKeyObj();
398 }
399
400 @Override
401 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
402 _shoppingItemPrice.setPrimaryKeyObj(primaryKeyObj);
403 }
404
405 @Override
406 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
407 return _shoppingItemPrice.getExpandoBridge();
408 }
409
410 @Override
411 public void setExpandoBridgeAttributes(
412 com.liferay.portal.model.BaseModel<?> baseModel) {
413 _shoppingItemPrice.setExpandoBridgeAttributes(baseModel);
414 }
415
416 @Override
417 public void setExpandoBridgeAttributes(
418 com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
419 _shoppingItemPrice.setExpandoBridgeAttributes(expandoBridge);
420 }
421
422 @Override
423 public void setExpandoBridgeAttributes(
424 com.liferay.portal.service.ServiceContext serviceContext) {
425 _shoppingItemPrice.setExpandoBridgeAttributes(serviceContext);
426 }
427
428 @Override
429 public java.lang.Object clone() {
430 return new ShoppingItemPriceWrapper((ShoppingItemPrice)_shoppingItemPrice.clone());
431 }
432
433 @Override
434 public int compareTo(
435 com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice) {
436 return _shoppingItemPrice.compareTo(shoppingItemPrice);
437 }
438
439 @Override
440 public int hashCode() {
441 return _shoppingItemPrice.hashCode();
442 }
443
444 @Override
445 public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingItemPrice> toCacheModel() {
446 return _shoppingItemPrice.toCacheModel();
447 }
448
449 @Override
450 public com.liferay.portlet.shopping.model.ShoppingItemPrice toEscapedModel() {
451 return new ShoppingItemPriceWrapper(_shoppingItemPrice.toEscapedModel());
452 }
453
454 @Override
455 public com.liferay.portlet.shopping.model.ShoppingItemPrice toUnescapedModel() {
456 return new ShoppingItemPriceWrapper(_shoppingItemPrice.toUnescapedModel());
457 }
458
459 @Override
460 public java.lang.String toString() {
461 return _shoppingItemPrice.toString();
462 }
463
464 @Override
465 public java.lang.String toXmlString() {
466 return _shoppingItemPrice.toXmlString();
467 }
468
469 @Override
470 public void persist()
471 throws com.liferay.portal.kernel.exception.SystemException {
472 _shoppingItemPrice.persist();
473 }
474
475 @Override
476 public boolean equals(Object obj) {
477 if (this == obj) {
478 return true;
479 }
480
481 if (!(obj instanceof ShoppingItemPriceWrapper)) {
482 return false;
483 }
484
485 ShoppingItemPriceWrapper shoppingItemPriceWrapper = (ShoppingItemPriceWrapper)obj;
486
487 if (Validator.equals(_shoppingItemPrice,
488 shoppingItemPriceWrapper._shoppingItemPrice)) {
489 return true;
490 }
491
492 return false;
493 }
494
495
498 public ShoppingItemPrice getWrappedShoppingItemPrice() {
499 return _shoppingItemPrice;
500 }
501
502 @Override
503 public ShoppingItemPrice getWrappedModel() {
504 return _shoppingItemPrice;
505 }
506
507 @Override
508 public void resetOriginalValues() {
509 _shoppingItemPrice.resetOriginalValues();
510 }
511
512 private ShoppingItemPrice _shoppingItemPrice;
513 }