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.Date;
021 import java.util.HashMap;
022 import java.util.Map;
023
024
033 public class ShoppingCartWrapper implements ShoppingCart,
034 ModelWrapper<ShoppingCart> {
035 public ShoppingCartWrapper(ShoppingCart shoppingCart) {
036 _shoppingCart = shoppingCart;
037 }
038
039 public Class<?> getModelClass() {
040 return ShoppingCart.class;
041 }
042
043 public String getModelClassName() {
044 return ShoppingCart.class.getName();
045 }
046
047 public Map<String, Object> getModelAttributes() {
048 Map<String, Object> attributes = new HashMap<String, Object>();
049
050 attributes.put("cartId", getCartId());
051 attributes.put("groupId", getGroupId());
052 attributes.put("companyId", getCompanyId());
053 attributes.put("userId", getUserId());
054 attributes.put("userName", getUserName());
055 attributes.put("createDate", getCreateDate());
056 attributes.put("modifiedDate", getModifiedDate());
057 attributes.put("itemIds", getItemIds());
058 attributes.put("couponCodes", getCouponCodes());
059 attributes.put("altShipping", getAltShipping());
060 attributes.put("insure", getInsure());
061
062 return attributes;
063 }
064
065 public void setModelAttributes(Map<String, Object> attributes) {
066 Long cartId = (Long)attributes.get("cartId");
067
068 if (cartId != null) {
069 setCartId(cartId);
070 }
071
072 Long groupId = (Long)attributes.get("groupId");
073
074 if (groupId != null) {
075 setGroupId(groupId);
076 }
077
078 Long companyId = (Long)attributes.get("companyId");
079
080 if (companyId != null) {
081 setCompanyId(companyId);
082 }
083
084 Long userId = (Long)attributes.get("userId");
085
086 if (userId != null) {
087 setUserId(userId);
088 }
089
090 String userName = (String)attributes.get("userName");
091
092 if (userName != null) {
093 setUserName(userName);
094 }
095
096 Date createDate = (Date)attributes.get("createDate");
097
098 if (createDate != null) {
099 setCreateDate(createDate);
100 }
101
102 Date modifiedDate = (Date)attributes.get("modifiedDate");
103
104 if (modifiedDate != null) {
105 setModifiedDate(modifiedDate);
106 }
107
108 String itemIds = (String)attributes.get("itemIds");
109
110 if (itemIds != null) {
111 setItemIds(itemIds);
112 }
113
114 String couponCodes = (String)attributes.get("couponCodes");
115
116 if (couponCodes != null) {
117 setCouponCodes(couponCodes);
118 }
119
120 Integer altShipping = (Integer)attributes.get("altShipping");
121
122 if (altShipping != null) {
123 setAltShipping(altShipping);
124 }
125
126 Boolean insure = (Boolean)attributes.get("insure");
127
128 if (insure != null) {
129 setInsure(insure);
130 }
131 }
132
133
138 public long getPrimaryKey() {
139 return _shoppingCart.getPrimaryKey();
140 }
141
142
147 public void setPrimaryKey(long primaryKey) {
148 _shoppingCart.setPrimaryKey(primaryKey);
149 }
150
151
156 public long getCartId() {
157 return _shoppingCart.getCartId();
158 }
159
160
165 public void setCartId(long cartId) {
166 _shoppingCart.setCartId(cartId);
167 }
168
169
174 public long getGroupId() {
175 return _shoppingCart.getGroupId();
176 }
177
178
183 public void setGroupId(long groupId) {
184 _shoppingCart.setGroupId(groupId);
185 }
186
187
192 public long getCompanyId() {
193 return _shoppingCart.getCompanyId();
194 }
195
196
201 public void setCompanyId(long companyId) {
202 _shoppingCart.setCompanyId(companyId);
203 }
204
205
210 public long getUserId() {
211 return _shoppingCart.getUserId();
212 }
213
214
219 public void setUserId(long userId) {
220 _shoppingCart.setUserId(userId);
221 }
222
223
229 public java.lang.String getUserUuid()
230 throws com.liferay.portal.kernel.exception.SystemException {
231 return _shoppingCart.getUserUuid();
232 }
233
234
239 public void setUserUuid(java.lang.String userUuid) {
240 _shoppingCart.setUserUuid(userUuid);
241 }
242
243
248 public java.lang.String getUserName() {
249 return _shoppingCart.getUserName();
250 }
251
252
257 public void setUserName(java.lang.String userName) {
258 _shoppingCart.setUserName(userName);
259 }
260
261
266 public java.util.Date getCreateDate() {
267 return _shoppingCart.getCreateDate();
268 }
269
270
275 public void setCreateDate(java.util.Date createDate) {
276 _shoppingCart.setCreateDate(createDate);
277 }
278
279
284 public java.util.Date getModifiedDate() {
285 return _shoppingCart.getModifiedDate();
286 }
287
288
293 public void setModifiedDate(java.util.Date modifiedDate) {
294 _shoppingCart.setModifiedDate(modifiedDate);
295 }
296
297
302 public java.lang.String getItemIds() {
303 return _shoppingCart.getItemIds();
304 }
305
306
311 public void setItemIds(java.lang.String itemIds) {
312 _shoppingCart.setItemIds(itemIds);
313 }
314
315
320 public java.lang.String getCouponCodes() {
321 return _shoppingCart.getCouponCodes();
322 }
323
324
329 public void setCouponCodes(java.lang.String couponCodes) {
330 _shoppingCart.setCouponCodes(couponCodes);
331 }
332
333
338 public int getAltShipping() {
339 return _shoppingCart.getAltShipping();
340 }
341
342
347 public void setAltShipping(int altShipping) {
348 _shoppingCart.setAltShipping(altShipping);
349 }
350
351
356 public boolean getInsure() {
357 return _shoppingCart.getInsure();
358 }
359
360
365 public boolean isInsure() {
366 return _shoppingCart.isInsure();
367 }
368
369
374 public void setInsure(boolean insure) {
375 _shoppingCart.setInsure(insure);
376 }
377
378 public boolean isNew() {
379 return _shoppingCart.isNew();
380 }
381
382 public void setNew(boolean n) {
383 _shoppingCart.setNew(n);
384 }
385
386 public boolean isCachedModel() {
387 return _shoppingCart.isCachedModel();
388 }
389
390 public void setCachedModel(boolean cachedModel) {
391 _shoppingCart.setCachedModel(cachedModel);
392 }
393
394 public boolean isEscapedModel() {
395 return _shoppingCart.isEscapedModel();
396 }
397
398 public java.io.Serializable getPrimaryKeyObj() {
399 return _shoppingCart.getPrimaryKeyObj();
400 }
401
402 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
403 _shoppingCart.setPrimaryKeyObj(primaryKeyObj);
404 }
405
406 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
407 return _shoppingCart.getExpandoBridge();
408 }
409
410 public void setExpandoBridgeAttributes(
411 com.liferay.portal.service.ServiceContext serviceContext) {
412 _shoppingCart.setExpandoBridgeAttributes(serviceContext);
413 }
414
415 @Override
416 public java.lang.Object clone() {
417 return new ShoppingCartWrapper((ShoppingCart)_shoppingCart.clone());
418 }
419
420 public int compareTo(
421 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) {
422 return _shoppingCart.compareTo(shoppingCart);
423 }
424
425 @Override
426 public int hashCode() {
427 return _shoppingCart.hashCode();
428 }
429
430 public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingCart> toCacheModel() {
431 return _shoppingCart.toCacheModel();
432 }
433
434 public com.liferay.portlet.shopping.model.ShoppingCart toEscapedModel() {
435 return new ShoppingCartWrapper(_shoppingCart.toEscapedModel());
436 }
437
438 public com.liferay.portlet.shopping.model.ShoppingCart toUnescapedModel() {
439 return new ShoppingCartWrapper(_shoppingCart.toUnescapedModel());
440 }
441
442 @Override
443 public java.lang.String toString() {
444 return _shoppingCart.toString();
445 }
446
447 public java.lang.String toXmlString() {
448 return _shoppingCart.toXmlString();
449 }
450
451 public void persist()
452 throws com.liferay.portal.kernel.exception.SystemException {
453 _shoppingCart.persist();
454 }
455
456 public void addItemId(long itemId, java.lang.String fields) {
457 _shoppingCart.addItemId(itemId, fields);
458 }
459
460 public com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon()
461 throws com.liferay.portal.kernel.exception.PortalException,
462 com.liferay.portal.kernel.exception.SystemException {
463 return _shoppingCart.getCoupon();
464 }
465
466 public java.util.Map<com.liferay.portlet.shopping.model.ShoppingCartItem, java.lang.Integer> getItems()
467 throws com.liferay.portal.kernel.exception.SystemException {
468 return _shoppingCart.getItems();
469 }
470
471 public int getItemsSize() {
472 return _shoppingCart.getItemsSize();
473 }
474
475 @Override
476 public boolean equals(Object obj) {
477 if (this == obj) {
478 return true;
479 }
480
481 if (!(obj instanceof ShoppingCartWrapper)) {
482 return false;
483 }
484
485 ShoppingCartWrapper shoppingCartWrapper = (ShoppingCartWrapper)obj;
486
487 if (Validator.equals(_shoppingCart, shoppingCartWrapper._shoppingCart)) {
488 return true;
489 }
490
491 return false;
492 }
493
494
497 public ShoppingCart getWrappedShoppingCart() {
498 return _shoppingCart;
499 }
500
501 public ShoppingCart getWrappedModel() {
502 return _shoppingCart;
503 }
504
505 public void resetOriginalValues() {
506 _shoppingCart.resetOriginalValues();
507 }
508
509 private ShoppingCart _shoppingCart;
510 }