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 public Class<?> getModelClass() {
039 return ShoppingItemPrice.class;
040 }
041
042 public String getModelClassName() {
043 return ShoppingItemPrice.class.getName();
044 }
045
046 public Map<String, Object> getModelAttributes() {
047 Map<String, Object> attributes = new HashMap<String, Object>();
048
049 attributes.put("itemPriceId", getItemPriceId());
050 attributes.put("itemId", getItemId());
051 attributes.put("minQuantity", getMinQuantity());
052 attributes.put("maxQuantity", getMaxQuantity());
053 attributes.put("price", getPrice());
054 attributes.put("discount", getDiscount());
055 attributes.put("taxable", getTaxable());
056 attributes.put("shipping", getShipping());
057 attributes.put("useShippingFormula", getUseShippingFormula());
058 attributes.put("status", getStatus());
059
060 return attributes;
061 }
062
063 public void setModelAttributes(Map<String, Object> attributes) {
064 Long itemPriceId = (Long)attributes.get("itemPriceId");
065
066 if (itemPriceId != null) {
067 setItemPriceId(itemPriceId);
068 }
069
070 Long itemId = (Long)attributes.get("itemId");
071
072 if (itemId != null) {
073 setItemId(itemId);
074 }
075
076 Integer minQuantity = (Integer)attributes.get("minQuantity");
077
078 if (minQuantity != null) {
079 setMinQuantity(minQuantity);
080 }
081
082 Integer maxQuantity = (Integer)attributes.get("maxQuantity");
083
084 if (maxQuantity != null) {
085 setMaxQuantity(maxQuantity);
086 }
087
088 Double price = (Double)attributes.get("price");
089
090 if (price != null) {
091 setPrice(price);
092 }
093
094 Double discount = (Double)attributes.get("discount");
095
096 if (discount != null) {
097 setDiscount(discount);
098 }
099
100 Boolean taxable = (Boolean)attributes.get("taxable");
101
102 if (taxable != null) {
103 setTaxable(taxable);
104 }
105
106 Double shipping = (Double)attributes.get("shipping");
107
108 if (shipping != null) {
109 setShipping(shipping);
110 }
111
112 Boolean useShippingFormula = (Boolean)attributes.get(
113 "useShippingFormula");
114
115 if (useShippingFormula != null) {
116 setUseShippingFormula(useShippingFormula);
117 }
118
119 Integer status = (Integer)attributes.get("status");
120
121 if (status != null) {
122 setStatus(status);
123 }
124 }
125
126
131 public long getPrimaryKey() {
132 return _shoppingItemPrice.getPrimaryKey();
133 }
134
135
140 public void setPrimaryKey(long primaryKey) {
141 _shoppingItemPrice.setPrimaryKey(primaryKey);
142 }
143
144
149 public long getItemPriceId() {
150 return _shoppingItemPrice.getItemPriceId();
151 }
152
153
158 public void setItemPriceId(long itemPriceId) {
159 _shoppingItemPrice.setItemPriceId(itemPriceId);
160 }
161
162
167 public long getItemId() {
168 return _shoppingItemPrice.getItemId();
169 }
170
171
176 public void setItemId(long itemId) {
177 _shoppingItemPrice.setItemId(itemId);
178 }
179
180
185 public int getMinQuantity() {
186 return _shoppingItemPrice.getMinQuantity();
187 }
188
189
194 public void setMinQuantity(int minQuantity) {
195 _shoppingItemPrice.setMinQuantity(minQuantity);
196 }
197
198
203 public int getMaxQuantity() {
204 return _shoppingItemPrice.getMaxQuantity();
205 }
206
207
212 public void setMaxQuantity(int maxQuantity) {
213 _shoppingItemPrice.setMaxQuantity(maxQuantity);
214 }
215
216
221 public double getPrice() {
222 return _shoppingItemPrice.getPrice();
223 }
224
225
230 public void setPrice(double price) {
231 _shoppingItemPrice.setPrice(price);
232 }
233
234
239 public double getDiscount() {
240 return _shoppingItemPrice.getDiscount();
241 }
242
243
248 public void setDiscount(double discount) {
249 _shoppingItemPrice.setDiscount(discount);
250 }
251
252
257 public boolean getTaxable() {
258 return _shoppingItemPrice.getTaxable();
259 }
260
261
266 public boolean isTaxable() {
267 return _shoppingItemPrice.isTaxable();
268 }
269
270
275 public void setTaxable(boolean taxable) {
276 _shoppingItemPrice.setTaxable(taxable);
277 }
278
279
284 public double getShipping() {
285 return _shoppingItemPrice.getShipping();
286 }
287
288
293 public void setShipping(double shipping) {
294 _shoppingItemPrice.setShipping(shipping);
295 }
296
297
302 public boolean getUseShippingFormula() {
303 return _shoppingItemPrice.getUseShippingFormula();
304 }
305
306
311 public boolean isUseShippingFormula() {
312 return _shoppingItemPrice.isUseShippingFormula();
313 }
314
315
320 public void setUseShippingFormula(boolean useShippingFormula) {
321 _shoppingItemPrice.setUseShippingFormula(useShippingFormula);
322 }
323
324
329 public int getStatus() {
330 return _shoppingItemPrice.getStatus();
331 }
332
333
338 public void setStatus(int status) {
339 _shoppingItemPrice.setStatus(status);
340 }
341
342 public boolean isNew() {
343 return _shoppingItemPrice.isNew();
344 }
345
346 public void setNew(boolean n) {
347 _shoppingItemPrice.setNew(n);
348 }
349
350 public boolean isCachedModel() {
351 return _shoppingItemPrice.isCachedModel();
352 }
353
354 public void setCachedModel(boolean cachedModel) {
355 _shoppingItemPrice.setCachedModel(cachedModel);
356 }
357
358 public boolean isEscapedModel() {
359 return _shoppingItemPrice.isEscapedModel();
360 }
361
362 public java.io.Serializable getPrimaryKeyObj() {
363 return _shoppingItemPrice.getPrimaryKeyObj();
364 }
365
366 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
367 _shoppingItemPrice.setPrimaryKeyObj(primaryKeyObj);
368 }
369
370 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
371 return _shoppingItemPrice.getExpandoBridge();
372 }
373
374 public void setExpandoBridgeAttributes(
375 com.liferay.portal.service.ServiceContext serviceContext) {
376 _shoppingItemPrice.setExpandoBridgeAttributes(serviceContext);
377 }
378
379 @Override
380 public java.lang.Object clone() {
381 return new ShoppingItemPriceWrapper((ShoppingItemPrice)_shoppingItemPrice.clone());
382 }
383
384 public int compareTo(
385 com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice) {
386 return _shoppingItemPrice.compareTo(shoppingItemPrice);
387 }
388
389 @Override
390 public int hashCode() {
391 return _shoppingItemPrice.hashCode();
392 }
393
394 public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingItemPrice> toCacheModel() {
395 return _shoppingItemPrice.toCacheModel();
396 }
397
398 public com.liferay.portlet.shopping.model.ShoppingItemPrice toEscapedModel() {
399 return new ShoppingItemPriceWrapper(_shoppingItemPrice.toEscapedModel());
400 }
401
402 public com.liferay.portlet.shopping.model.ShoppingItemPrice toUnescapedModel() {
403 return new ShoppingItemPriceWrapper(_shoppingItemPrice.toUnescapedModel());
404 }
405
406 @Override
407 public java.lang.String toString() {
408 return _shoppingItemPrice.toString();
409 }
410
411 public java.lang.String toXmlString() {
412 return _shoppingItemPrice.toXmlString();
413 }
414
415 public void persist()
416 throws com.liferay.portal.kernel.exception.SystemException {
417 _shoppingItemPrice.persist();
418 }
419
420 @Override
421 public boolean equals(Object obj) {
422 if (this == obj) {
423 return true;
424 }
425
426 if (!(obj instanceof ShoppingItemPriceWrapper)) {
427 return false;
428 }
429
430 ShoppingItemPriceWrapper shoppingItemPriceWrapper = (ShoppingItemPriceWrapper)obj;
431
432 if (Validator.equals(_shoppingItemPrice,
433 shoppingItemPriceWrapper._shoppingItemPrice)) {
434 return true;
435 }
436
437 return false;
438 }
439
440
443 public ShoppingItemPrice getWrappedShoppingItemPrice() {
444 return _shoppingItemPrice;
445 }
446
447 public ShoppingItemPrice getWrappedModel() {
448 return _shoppingItemPrice;
449 }
450
451 public void resetOriginalValues() {
452 _shoppingItemPrice.resetOriginalValues();
453 }
454
455 private ShoppingItemPrice _shoppingItemPrice;
456 }