001
014
015 package com.liferay.portlet.shopping.model;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.util.Validator;
020 import com.liferay.portal.model.ModelWrapper;
021
022 import java.util.HashMap;
023 import java.util.Map;
024
025
034 @ProviderType
035 public class ShoppingItemPriceWrapper implements ShoppingItemPrice,
036 ModelWrapper<ShoppingItemPrice> {
037 public ShoppingItemPriceWrapper(ShoppingItemPrice shoppingItemPrice) {
038 _shoppingItemPrice = shoppingItemPrice;
039 }
040
041 @Override
042 public Class<?> getModelClass() {
043 return ShoppingItemPrice.class;
044 }
045
046 @Override
047 public String getModelClassName() {
048 return ShoppingItemPrice.class.getName();
049 }
050
051 @Override
052 public Map<String, Object> getModelAttributes() {
053 Map<String, Object> attributes = new HashMap<String, Object>();
054
055 attributes.put("itemPriceId", getItemPriceId());
056 attributes.put("itemId", getItemId());
057 attributes.put("minQuantity", getMinQuantity());
058 attributes.put("maxQuantity", getMaxQuantity());
059 attributes.put("price", getPrice());
060 attributes.put("discount", getDiscount());
061 attributes.put("taxable", getTaxable());
062 attributes.put("shipping", getShipping());
063 attributes.put("useShippingFormula", getUseShippingFormula());
064 attributes.put("status", getStatus());
065
066 return attributes;
067 }
068
069 @Override
070 public void setModelAttributes(Map<String, Object> attributes) {
071 Long itemPriceId = (Long)attributes.get("itemPriceId");
072
073 if (itemPriceId != null) {
074 setItemPriceId(itemPriceId);
075 }
076
077 Long itemId = (Long)attributes.get("itemId");
078
079 if (itemId != null) {
080 setItemId(itemId);
081 }
082
083 Integer minQuantity = (Integer)attributes.get("minQuantity");
084
085 if (minQuantity != null) {
086 setMinQuantity(minQuantity);
087 }
088
089 Integer maxQuantity = (Integer)attributes.get("maxQuantity");
090
091 if (maxQuantity != null) {
092 setMaxQuantity(maxQuantity);
093 }
094
095 Double price = (Double)attributes.get("price");
096
097 if (price != null) {
098 setPrice(price);
099 }
100
101 Double discount = (Double)attributes.get("discount");
102
103 if (discount != null) {
104 setDiscount(discount);
105 }
106
107 Boolean taxable = (Boolean)attributes.get("taxable");
108
109 if (taxable != null) {
110 setTaxable(taxable);
111 }
112
113 Double shipping = (Double)attributes.get("shipping");
114
115 if (shipping != null) {
116 setShipping(shipping);
117 }
118
119 Boolean useShippingFormula = (Boolean)attributes.get(
120 "useShippingFormula");
121
122 if (useShippingFormula != null) {
123 setUseShippingFormula(useShippingFormula);
124 }
125
126 Integer status = (Integer)attributes.get("status");
127
128 if (status != null) {
129 setStatus(status);
130 }
131 }
132
133
138 @Override
139 public long getPrimaryKey() {
140 return _shoppingItemPrice.getPrimaryKey();
141 }
142
143
148 @Override
149 public void setPrimaryKey(long primaryKey) {
150 _shoppingItemPrice.setPrimaryKey(primaryKey);
151 }
152
153
158 @Override
159 public long getItemPriceId() {
160 return _shoppingItemPrice.getItemPriceId();
161 }
162
163
168 @Override
169 public void setItemPriceId(long itemPriceId) {
170 _shoppingItemPrice.setItemPriceId(itemPriceId);
171 }
172
173
178 @Override
179 public long getItemId() {
180 return _shoppingItemPrice.getItemId();
181 }
182
183
188 @Override
189 public void setItemId(long itemId) {
190 _shoppingItemPrice.setItemId(itemId);
191 }
192
193
198 @Override
199 public int getMinQuantity() {
200 return _shoppingItemPrice.getMinQuantity();
201 }
202
203
208 @Override
209 public void setMinQuantity(int minQuantity) {
210 _shoppingItemPrice.setMinQuantity(minQuantity);
211 }
212
213
218 @Override
219 public int getMaxQuantity() {
220 return _shoppingItemPrice.getMaxQuantity();
221 }
222
223
228 @Override
229 public void setMaxQuantity(int maxQuantity) {
230 _shoppingItemPrice.setMaxQuantity(maxQuantity);
231 }
232
233
238 @Override
239 public double getPrice() {
240 return _shoppingItemPrice.getPrice();
241 }
242
243
248 @Override
249 public void setPrice(double price) {
250 _shoppingItemPrice.setPrice(price);
251 }
252
253
258 @Override
259 public double getDiscount() {
260 return _shoppingItemPrice.getDiscount();
261 }
262
263
268 @Override
269 public void setDiscount(double discount) {
270 _shoppingItemPrice.setDiscount(discount);
271 }
272
273
278 @Override
279 public boolean getTaxable() {
280 return _shoppingItemPrice.getTaxable();
281 }
282
283
288 @Override
289 public boolean isTaxable() {
290 return _shoppingItemPrice.isTaxable();
291 }
292
293
298 @Override
299 public void setTaxable(boolean taxable) {
300 _shoppingItemPrice.setTaxable(taxable);
301 }
302
303
308 @Override
309 public double getShipping() {
310 return _shoppingItemPrice.getShipping();
311 }
312
313
318 @Override
319 public void setShipping(double shipping) {
320 _shoppingItemPrice.setShipping(shipping);
321 }
322
323
328 @Override
329 public boolean getUseShippingFormula() {
330 return _shoppingItemPrice.getUseShippingFormula();
331 }
332
333
338 @Override
339 public boolean isUseShippingFormula() {
340 return _shoppingItemPrice.isUseShippingFormula();
341 }
342
343
348 @Override
349 public void setUseShippingFormula(boolean useShippingFormula) {
350 _shoppingItemPrice.setUseShippingFormula(useShippingFormula);
351 }
352
353
358 @Override
359 public int getStatus() {
360 return _shoppingItemPrice.getStatus();
361 }
362
363
368 @Override
369 public void setStatus(int status) {
370 _shoppingItemPrice.setStatus(status);
371 }
372
373 @Override
374 public boolean isNew() {
375 return _shoppingItemPrice.isNew();
376 }
377
378 @Override
379 public void setNew(boolean n) {
380 _shoppingItemPrice.setNew(n);
381 }
382
383 @Override
384 public boolean isCachedModel() {
385 return _shoppingItemPrice.isCachedModel();
386 }
387
388 @Override
389 public void setCachedModel(boolean cachedModel) {
390 _shoppingItemPrice.setCachedModel(cachedModel);
391 }
392
393 @Override
394 public boolean isEscapedModel() {
395 return _shoppingItemPrice.isEscapedModel();
396 }
397
398 @Override
399 public java.io.Serializable getPrimaryKeyObj() {
400 return _shoppingItemPrice.getPrimaryKeyObj();
401 }
402
403 @Override
404 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
405 _shoppingItemPrice.setPrimaryKeyObj(primaryKeyObj);
406 }
407
408 @Override
409 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
410 return _shoppingItemPrice.getExpandoBridge();
411 }
412
413 @Override
414 public void setExpandoBridgeAttributes(
415 com.liferay.portal.model.BaseModel<?> baseModel) {
416 _shoppingItemPrice.setExpandoBridgeAttributes(baseModel);
417 }
418
419 @Override
420 public void setExpandoBridgeAttributes(
421 com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
422 _shoppingItemPrice.setExpandoBridgeAttributes(expandoBridge);
423 }
424
425 @Override
426 public void setExpandoBridgeAttributes(
427 com.liferay.portal.service.ServiceContext serviceContext) {
428 _shoppingItemPrice.setExpandoBridgeAttributes(serviceContext);
429 }
430
431 @Override
432 public java.lang.Object clone() {
433 return new ShoppingItemPriceWrapper((ShoppingItemPrice)_shoppingItemPrice.clone());
434 }
435
436 @Override
437 public int compareTo(
438 com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice) {
439 return _shoppingItemPrice.compareTo(shoppingItemPrice);
440 }
441
442 @Override
443 public int hashCode() {
444 return _shoppingItemPrice.hashCode();
445 }
446
447 @Override
448 public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingItemPrice> toCacheModel() {
449 return _shoppingItemPrice.toCacheModel();
450 }
451
452 @Override
453 public com.liferay.portlet.shopping.model.ShoppingItemPrice toEscapedModel() {
454 return new ShoppingItemPriceWrapper(_shoppingItemPrice.toEscapedModel());
455 }
456
457 @Override
458 public com.liferay.portlet.shopping.model.ShoppingItemPrice toUnescapedModel() {
459 return new ShoppingItemPriceWrapper(_shoppingItemPrice.toUnescapedModel());
460 }
461
462 @Override
463 public java.lang.String toString() {
464 return _shoppingItemPrice.toString();
465 }
466
467 @Override
468 public java.lang.String toXmlString() {
469 return _shoppingItemPrice.toXmlString();
470 }
471
472 @Override
473 public void persist()
474 throws com.liferay.portal.kernel.exception.SystemException {
475 _shoppingItemPrice.persist();
476 }
477
478 @Override
479 public boolean equals(Object obj) {
480 if (this == obj) {
481 return true;
482 }
483
484 if (!(obj instanceof ShoppingItemPriceWrapper)) {
485 return false;
486 }
487
488 ShoppingItemPriceWrapper shoppingItemPriceWrapper = (ShoppingItemPriceWrapper)obj;
489
490 if (Validator.equals(_shoppingItemPrice,
491 shoppingItemPriceWrapper._shoppingItemPrice)) {
492 return true;
493 }
494
495 return false;
496 }
497
498
501 public ShoppingItemPrice getWrappedShoppingItemPrice() {
502 return _shoppingItemPrice;
503 }
504
505 @Override
506 public ShoppingItemPrice getWrappedModel() {
507 return _shoppingItemPrice;
508 }
509
510 @Override
511 public void resetOriginalValues() {
512 _shoppingItemPrice.resetOriginalValues();
513 }
514
515 private ShoppingItemPrice _shoppingItemPrice;
516 }