001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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    /**
025     * <p>
026     * This class is a wrapper for {@link ShoppingCart}.
027     * </p>
028     *
029     * @author    Brian Wing Shun Chan
030     * @see       ShoppingCart
031     * @generated
032     */
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            /**
134            * Returns the primary key of this shopping cart.
135            *
136            * @return the primary key of this shopping cart
137            */
138            public long getPrimaryKey() {
139                    return _shoppingCart.getPrimaryKey();
140            }
141    
142            /**
143            * Sets the primary key of this shopping cart.
144            *
145            * @param primaryKey the primary key of this shopping cart
146            */
147            public void setPrimaryKey(long primaryKey) {
148                    _shoppingCart.setPrimaryKey(primaryKey);
149            }
150    
151            /**
152            * Returns the cart ID of this shopping cart.
153            *
154            * @return the cart ID of this shopping cart
155            */
156            public long getCartId() {
157                    return _shoppingCart.getCartId();
158            }
159    
160            /**
161            * Sets the cart ID of this shopping cart.
162            *
163            * @param cartId the cart ID of this shopping cart
164            */
165            public void setCartId(long cartId) {
166                    _shoppingCart.setCartId(cartId);
167            }
168    
169            /**
170            * Returns the group ID of this shopping cart.
171            *
172            * @return the group ID of this shopping cart
173            */
174            public long getGroupId() {
175                    return _shoppingCart.getGroupId();
176            }
177    
178            /**
179            * Sets the group ID of this shopping cart.
180            *
181            * @param groupId the group ID of this shopping cart
182            */
183            public void setGroupId(long groupId) {
184                    _shoppingCart.setGroupId(groupId);
185            }
186    
187            /**
188            * Returns the company ID of this shopping cart.
189            *
190            * @return the company ID of this shopping cart
191            */
192            public long getCompanyId() {
193                    return _shoppingCart.getCompanyId();
194            }
195    
196            /**
197            * Sets the company ID of this shopping cart.
198            *
199            * @param companyId the company ID of this shopping cart
200            */
201            public void setCompanyId(long companyId) {
202                    _shoppingCart.setCompanyId(companyId);
203            }
204    
205            /**
206            * Returns the user ID of this shopping cart.
207            *
208            * @return the user ID of this shopping cart
209            */
210            public long getUserId() {
211                    return _shoppingCart.getUserId();
212            }
213    
214            /**
215            * Sets the user ID of this shopping cart.
216            *
217            * @param userId the user ID of this shopping cart
218            */
219            public void setUserId(long userId) {
220                    _shoppingCart.setUserId(userId);
221            }
222    
223            /**
224            * Returns the user uuid of this shopping cart.
225            *
226            * @return the user uuid of this shopping cart
227            * @throws SystemException if a system exception occurred
228            */
229            public java.lang.String getUserUuid()
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return _shoppingCart.getUserUuid();
232            }
233    
234            /**
235            * Sets the user uuid of this shopping cart.
236            *
237            * @param userUuid the user uuid of this shopping cart
238            */
239            public void setUserUuid(java.lang.String userUuid) {
240                    _shoppingCart.setUserUuid(userUuid);
241            }
242    
243            /**
244            * Returns the user name of this shopping cart.
245            *
246            * @return the user name of this shopping cart
247            */
248            public java.lang.String getUserName() {
249                    return _shoppingCart.getUserName();
250            }
251    
252            /**
253            * Sets the user name of this shopping cart.
254            *
255            * @param userName the user name of this shopping cart
256            */
257            public void setUserName(java.lang.String userName) {
258                    _shoppingCart.setUserName(userName);
259            }
260    
261            /**
262            * Returns the create date of this shopping cart.
263            *
264            * @return the create date of this shopping cart
265            */
266            public java.util.Date getCreateDate() {
267                    return _shoppingCart.getCreateDate();
268            }
269    
270            /**
271            * Sets the create date of this shopping cart.
272            *
273            * @param createDate the create date of this shopping cart
274            */
275            public void setCreateDate(java.util.Date createDate) {
276                    _shoppingCart.setCreateDate(createDate);
277            }
278    
279            /**
280            * Returns the modified date of this shopping cart.
281            *
282            * @return the modified date of this shopping cart
283            */
284            public java.util.Date getModifiedDate() {
285                    return _shoppingCart.getModifiedDate();
286            }
287    
288            /**
289            * Sets the modified date of this shopping cart.
290            *
291            * @param modifiedDate the modified date of this shopping cart
292            */
293            public void setModifiedDate(java.util.Date modifiedDate) {
294                    _shoppingCart.setModifiedDate(modifiedDate);
295            }
296    
297            /**
298            * Returns the item IDs of this shopping cart.
299            *
300            * @return the item IDs of this shopping cart
301            */
302            public java.lang.String getItemIds() {
303                    return _shoppingCart.getItemIds();
304            }
305    
306            /**
307            * Sets the item IDs of this shopping cart.
308            *
309            * @param itemIds the item IDs of this shopping cart
310            */
311            public void setItemIds(java.lang.String itemIds) {
312                    _shoppingCart.setItemIds(itemIds);
313            }
314    
315            /**
316            * Returns the coupon codes of this shopping cart.
317            *
318            * @return the coupon codes of this shopping cart
319            */
320            public java.lang.String getCouponCodes() {
321                    return _shoppingCart.getCouponCodes();
322            }
323    
324            /**
325            * Sets the coupon codes of this shopping cart.
326            *
327            * @param couponCodes the coupon codes of this shopping cart
328            */
329            public void setCouponCodes(java.lang.String couponCodes) {
330                    _shoppingCart.setCouponCodes(couponCodes);
331            }
332    
333            /**
334            * Returns the alt shipping of this shopping cart.
335            *
336            * @return the alt shipping of this shopping cart
337            */
338            public int getAltShipping() {
339                    return _shoppingCart.getAltShipping();
340            }
341    
342            /**
343            * Sets the alt shipping of this shopping cart.
344            *
345            * @param altShipping the alt shipping of this shopping cart
346            */
347            public void setAltShipping(int altShipping) {
348                    _shoppingCart.setAltShipping(altShipping);
349            }
350    
351            /**
352            * Returns the insure of this shopping cart.
353            *
354            * @return the insure of this shopping cart
355            */
356            public boolean getInsure() {
357                    return _shoppingCart.getInsure();
358            }
359    
360            /**
361            * Returns <code>true</code> if this shopping cart is insure.
362            *
363            * @return <code>true</code> if this shopping cart is insure; <code>false</code> otherwise
364            */
365            public boolean isInsure() {
366                    return _shoppingCart.isInsure();
367            }
368    
369            /**
370            * Sets whether this shopping cart is insure.
371            *
372            * @param insure the insure of this shopping cart
373            */
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            /**
495             * @deprecated Renamed to {@link #getWrappedModel}
496             */
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    }