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.Date;
023 import java.util.HashMap;
024 import java.util.Map;
025
026
035 @ProviderType
036 public class ShoppingCartWrapper implements ShoppingCart,
037 ModelWrapper<ShoppingCart> {
038 public ShoppingCartWrapper(ShoppingCart shoppingCart) {
039 _shoppingCart = shoppingCart;
040 }
041
042 @Override
043 public Class<?> getModelClass() {
044 return ShoppingCart.class;
045 }
046
047 @Override
048 public String getModelClassName() {
049 return ShoppingCart.class.getName();
050 }
051
052 @Override
053 public Map<String, Object> getModelAttributes() {
054 Map<String, Object> attributes = new HashMap<String, Object>();
055
056 attributes.put("cartId", getCartId());
057 attributes.put("groupId", getGroupId());
058 attributes.put("companyId", getCompanyId());
059 attributes.put("userId", getUserId());
060 attributes.put("userName", getUserName());
061 attributes.put("createDate", getCreateDate());
062 attributes.put("modifiedDate", getModifiedDate());
063 attributes.put("itemIds", getItemIds());
064 attributes.put("couponCodes", getCouponCodes());
065 attributes.put("altShipping", getAltShipping());
066 attributes.put("insure", getInsure());
067
068 return attributes;
069 }
070
071 @Override
072 public void setModelAttributes(Map<String, Object> attributes) {
073 Long cartId = (Long)attributes.get("cartId");
074
075 if (cartId != null) {
076 setCartId(cartId);
077 }
078
079 Long groupId = (Long)attributes.get("groupId");
080
081 if (groupId != null) {
082 setGroupId(groupId);
083 }
084
085 Long companyId = (Long)attributes.get("companyId");
086
087 if (companyId != null) {
088 setCompanyId(companyId);
089 }
090
091 Long userId = (Long)attributes.get("userId");
092
093 if (userId != null) {
094 setUserId(userId);
095 }
096
097 String userName = (String)attributes.get("userName");
098
099 if (userName != null) {
100 setUserName(userName);
101 }
102
103 Date createDate = (Date)attributes.get("createDate");
104
105 if (createDate != null) {
106 setCreateDate(createDate);
107 }
108
109 Date modifiedDate = (Date)attributes.get("modifiedDate");
110
111 if (modifiedDate != null) {
112 setModifiedDate(modifiedDate);
113 }
114
115 String itemIds = (String)attributes.get("itemIds");
116
117 if (itemIds != null) {
118 setItemIds(itemIds);
119 }
120
121 String couponCodes = (String)attributes.get("couponCodes");
122
123 if (couponCodes != null) {
124 setCouponCodes(couponCodes);
125 }
126
127 Integer altShipping = (Integer)attributes.get("altShipping");
128
129 if (altShipping != null) {
130 setAltShipping(altShipping);
131 }
132
133 Boolean insure = (Boolean)attributes.get("insure");
134
135 if (insure != null) {
136 setInsure(insure);
137 }
138 }
139
140
145 @Override
146 public long getPrimaryKey() {
147 return _shoppingCart.getPrimaryKey();
148 }
149
150
155 @Override
156 public void setPrimaryKey(long primaryKey) {
157 _shoppingCart.setPrimaryKey(primaryKey);
158 }
159
160
165 @Override
166 public long getCartId() {
167 return _shoppingCart.getCartId();
168 }
169
170
175 @Override
176 public void setCartId(long cartId) {
177 _shoppingCart.setCartId(cartId);
178 }
179
180
185 @Override
186 public long getGroupId() {
187 return _shoppingCart.getGroupId();
188 }
189
190
195 @Override
196 public void setGroupId(long groupId) {
197 _shoppingCart.setGroupId(groupId);
198 }
199
200
205 @Override
206 public long getCompanyId() {
207 return _shoppingCart.getCompanyId();
208 }
209
210
215 @Override
216 public void setCompanyId(long companyId) {
217 _shoppingCart.setCompanyId(companyId);
218 }
219
220
225 @Override
226 public long getUserId() {
227 return _shoppingCart.getUserId();
228 }
229
230
235 @Override
236 public void setUserId(long userId) {
237 _shoppingCart.setUserId(userId);
238 }
239
240
246 @Override
247 public java.lang.String getUserUuid()
248 throws com.liferay.portal.kernel.exception.SystemException {
249 return _shoppingCart.getUserUuid();
250 }
251
252
257 @Override
258 public void setUserUuid(java.lang.String userUuid) {
259 _shoppingCart.setUserUuid(userUuid);
260 }
261
262
267 @Override
268 public java.lang.String getUserName() {
269 return _shoppingCart.getUserName();
270 }
271
272
277 @Override
278 public void setUserName(java.lang.String userName) {
279 _shoppingCart.setUserName(userName);
280 }
281
282
287 @Override
288 public java.util.Date getCreateDate() {
289 return _shoppingCart.getCreateDate();
290 }
291
292
297 @Override
298 public void setCreateDate(java.util.Date createDate) {
299 _shoppingCart.setCreateDate(createDate);
300 }
301
302
307 @Override
308 public java.util.Date getModifiedDate() {
309 return _shoppingCart.getModifiedDate();
310 }
311
312
317 @Override
318 public void setModifiedDate(java.util.Date modifiedDate) {
319 _shoppingCart.setModifiedDate(modifiedDate);
320 }
321
322
327 @Override
328 public java.lang.String getItemIds() {
329 return _shoppingCart.getItemIds();
330 }
331
332
337 @Override
338 public void setItemIds(java.lang.String itemIds) {
339 _shoppingCart.setItemIds(itemIds);
340 }
341
342
347 @Override
348 public java.lang.String getCouponCodes() {
349 return _shoppingCart.getCouponCodes();
350 }
351
352
357 @Override
358 public void setCouponCodes(java.lang.String couponCodes) {
359 _shoppingCart.setCouponCodes(couponCodes);
360 }
361
362
367 @Override
368 public int getAltShipping() {
369 return _shoppingCart.getAltShipping();
370 }
371
372
377 @Override
378 public void setAltShipping(int altShipping) {
379 _shoppingCart.setAltShipping(altShipping);
380 }
381
382
387 @Override
388 public boolean getInsure() {
389 return _shoppingCart.getInsure();
390 }
391
392
397 @Override
398 public boolean isInsure() {
399 return _shoppingCart.isInsure();
400 }
401
402
407 @Override
408 public void setInsure(boolean insure) {
409 _shoppingCart.setInsure(insure);
410 }
411
412 @Override
413 public boolean isNew() {
414 return _shoppingCart.isNew();
415 }
416
417 @Override
418 public void setNew(boolean n) {
419 _shoppingCart.setNew(n);
420 }
421
422 @Override
423 public boolean isCachedModel() {
424 return _shoppingCart.isCachedModel();
425 }
426
427 @Override
428 public void setCachedModel(boolean cachedModel) {
429 _shoppingCart.setCachedModel(cachedModel);
430 }
431
432 @Override
433 public boolean isEscapedModel() {
434 return _shoppingCart.isEscapedModel();
435 }
436
437 @Override
438 public java.io.Serializable getPrimaryKeyObj() {
439 return _shoppingCart.getPrimaryKeyObj();
440 }
441
442 @Override
443 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
444 _shoppingCart.setPrimaryKeyObj(primaryKeyObj);
445 }
446
447 @Override
448 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
449 return _shoppingCart.getExpandoBridge();
450 }
451
452 @Override
453 public void setExpandoBridgeAttributes(
454 com.liferay.portal.model.BaseModel<?> baseModel) {
455 _shoppingCart.setExpandoBridgeAttributes(baseModel);
456 }
457
458 @Override
459 public void setExpandoBridgeAttributes(
460 com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
461 _shoppingCart.setExpandoBridgeAttributes(expandoBridge);
462 }
463
464 @Override
465 public void setExpandoBridgeAttributes(
466 com.liferay.portal.service.ServiceContext serviceContext) {
467 _shoppingCart.setExpandoBridgeAttributes(serviceContext);
468 }
469
470 @Override
471 public java.lang.Object clone() {
472 return new ShoppingCartWrapper((ShoppingCart)_shoppingCart.clone());
473 }
474
475 @Override
476 public int compareTo(
477 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) {
478 return _shoppingCart.compareTo(shoppingCart);
479 }
480
481 @Override
482 public int hashCode() {
483 return _shoppingCart.hashCode();
484 }
485
486 @Override
487 public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingCart> toCacheModel() {
488 return _shoppingCart.toCacheModel();
489 }
490
491 @Override
492 public com.liferay.portlet.shopping.model.ShoppingCart toEscapedModel() {
493 return new ShoppingCartWrapper(_shoppingCart.toEscapedModel());
494 }
495
496 @Override
497 public com.liferay.portlet.shopping.model.ShoppingCart toUnescapedModel() {
498 return new ShoppingCartWrapper(_shoppingCart.toUnescapedModel());
499 }
500
501 @Override
502 public java.lang.String toString() {
503 return _shoppingCart.toString();
504 }
505
506 @Override
507 public java.lang.String toXmlString() {
508 return _shoppingCart.toXmlString();
509 }
510
511 @Override
512 public void persist()
513 throws com.liferay.portal.kernel.exception.SystemException {
514 _shoppingCart.persist();
515 }
516
517 @Override
518 public void addItemId(long itemId, java.lang.String fields) {
519 _shoppingCart.addItemId(itemId, fields);
520 }
521
522 @Override
523 public com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon()
524 throws com.liferay.portal.kernel.exception.PortalException,
525 com.liferay.portal.kernel.exception.SystemException {
526 return _shoppingCart.getCoupon();
527 }
528
529 @Override
530 public java.util.Map<com.liferay.portlet.shopping.model.ShoppingCartItem, java.lang.Integer> getItems()
531 throws com.liferay.portal.kernel.exception.SystemException {
532 return _shoppingCart.getItems();
533 }
534
535 @Override
536 public int getItemsSize() {
537 return _shoppingCart.getItemsSize();
538 }
539
540 @Override
541 public boolean equals(Object obj) {
542 if (this == obj) {
543 return true;
544 }
545
546 if (!(obj instanceof ShoppingCartWrapper)) {
547 return false;
548 }
549
550 ShoppingCartWrapper shoppingCartWrapper = (ShoppingCartWrapper)obj;
551
552 if (Validator.equals(_shoppingCart, shoppingCartWrapper._shoppingCart)) {
553 return true;
554 }
555
556 return false;
557 }
558
559
562 public ShoppingCart getWrappedShoppingCart() {
563 return _shoppingCart;
564 }
565
566 @Override
567 public ShoppingCart getWrappedModel() {
568 return _shoppingCart;
569 }
570
571 @Override
572 public void resetOriginalValues() {
573 _shoppingCart.resetOriginalValues();
574 }
575
576 private ShoppingCart _shoppingCart;
577 }