001    /**
002     * Copyright (c) 2000-2012 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.model.ModelWrapper;
018    
019    import java.util.Date;
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link ShoppingCart}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       ShoppingCart
030     * @generated
031     */
032    public class ShoppingCartWrapper implements ShoppingCart,
033            ModelWrapper<ShoppingCart> {
034            public ShoppingCartWrapper(ShoppingCart shoppingCart) {
035                    _shoppingCart = shoppingCart;
036            }
037    
038            public Class<?> getModelClass() {
039                    return ShoppingCart.class;
040            }
041    
042            public String getModelClassName() {
043                    return ShoppingCart.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("cartId", getCartId());
050                    attributes.put("groupId", getGroupId());
051                    attributes.put("companyId", getCompanyId());
052                    attributes.put("userId", getUserId());
053                    attributes.put("userName", getUserName());
054                    attributes.put("createDate", getCreateDate());
055                    attributes.put("modifiedDate", getModifiedDate());
056                    attributes.put("itemIds", getItemIds());
057                    attributes.put("couponCodes", getCouponCodes());
058                    attributes.put("altShipping", getAltShipping());
059                    attributes.put("insure", getInsure());
060    
061                    return attributes;
062            }
063    
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    Long cartId = (Long)attributes.get("cartId");
066    
067                    if (cartId != null) {
068                            setCartId(cartId);
069                    }
070    
071                    Long groupId = (Long)attributes.get("groupId");
072    
073                    if (groupId != null) {
074                            setGroupId(groupId);
075                    }
076    
077                    Long companyId = (Long)attributes.get("companyId");
078    
079                    if (companyId != null) {
080                            setCompanyId(companyId);
081                    }
082    
083                    Long userId = (Long)attributes.get("userId");
084    
085                    if (userId != null) {
086                            setUserId(userId);
087                    }
088    
089                    String userName = (String)attributes.get("userName");
090    
091                    if (userName != null) {
092                            setUserName(userName);
093                    }
094    
095                    Date createDate = (Date)attributes.get("createDate");
096    
097                    if (createDate != null) {
098                            setCreateDate(createDate);
099                    }
100    
101                    Date modifiedDate = (Date)attributes.get("modifiedDate");
102    
103                    if (modifiedDate != null) {
104                            setModifiedDate(modifiedDate);
105                    }
106    
107                    String itemIds = (String)attributes.get("itemIds");
108    
109                    if (itemIds != null) {
110                            setItemIds(itemIds);
111                    }
112    
113                    String couponCodes = (String)attributes.get("couponCodes");
114    
115                    if (couponCodes != null) {
116                            setCouponCodes(couponCodes);
117                    }
118    
119                    Integer altShipping = (Integer)attributes.get("altShipping");
120    
121                    if (altShipping != null) {
122                            setAltShipping(altShipping);
123                    }
124    
125                    Boolean insure = (Boolean)attributes.get("insure");
126    
127                    if (insure != null) {
128                            setInsure(insure);
129                    }
130            }
131    
132            /**
133            * Returns the primary key of this shopping cart.
134            *
135            * @return the primary key of this shopping cart
136            */
137            public long getPrimaryKey() {
138                    return _shoppingCart.getPrimaryKey();
139            }
140    
141            /**
142            * Sets the primary key of this shopping cart.
143            *
144            * @param primaryKey the primary key of this shopping cart
145            */
146            public void setPrimaryKey(long primaryKey) {
147                    _shoppingCart.setPrimaryKey(primaryKey);
148            }
149    
150            /**
151            * Returns the cart ID of this shopping cart.
152            *
153            * @return the cart ID of this shopping cart
154            */
155            public long getCartId() {
156                    return _shoppingCart.getCartId();
157            }
158    
159            /**
160            * Sets the cart ID of this shopping cart.
161            *
162            * @param cartId the cart ID of this shopping cart
163            */
164            public void setCartId(long cartId) {
165                    _shoppingCart.setCartId(cartId);
166            }
167    
168            /**
169            * Returns the group ID of this shopping cart.
170            *
171            * @return the group ID of this shopping cart
172            */
173            public long getGroupId() {
174                    return _shoppingCart.getGroupId();
175            }
176    
177            /**
178            * Sets the group ID of this shopping cart.
179            *
180            * @param groupId the group ID of this shopping cart
181            */
182            public void setGroupId(long groupId) {
183                    _shoppingCart.setGroupId(groupId);
184            }
185    
186            /**
187            * Returns the company ID of this shopping cart.
188            *
189            * @return the company ID of this shopping cart
190            */
191            public long getCompanyId() {
192                    return _shoppingCart.getCompanyId();
193            }
194    
195            /**
196            * Sets the company ID of this shopping cart.
197            *
198            * @param companyId the company ID of this shopping cart
199            */
200            public void setCompanyId(long companyId) {
201                    _shoppingCart.setCompanyId(companyId);
202            }
203    
204            /**
205            * Returns the user ID of this shopping cart.
206            *
207            * @return the user ID of this shopping cart
208            */
209            public long getUserId() {
210                    return _shoppingCart.getUserId();
211            }
212    
213            /**
214            * Sets the user ID of this shopping cart.
215            *
216            * @param userId the user ID of this shopping cart
217            */
218            public void setUserId(long userId) {
219                    _shoppingCart.setUserId(userId);
220            }
221    
222            /**
223            * Returns the user uuid of this shopping cart.
224            *
225            * @return the user uuid of this shopping cart
226            * @throws SystemException if a system exception occurred
227            */
228            public java.lang.String getUserUuid()
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return _shoppingCart.getUserUuid();
231            }
232    
233            /**
234            * Sets the user uuid of this shopping cart.
235            *
236            * @param userUuid the user uuid of this shopping cart
237            */
238            public void setUserUuid(java.lang.String userUuid) {
239                    _shoppingCart.setUserUuid(userUuid);
240            }
241    
242            /**
243            * Returns the user name of this shopping cart.
244            *
245            * @return the user name of this shopping cart
246            */
247            public java.lang.String getUserName() {
248                    return _shoppingCart.getUserName();
249            }
250    
251            /**
252            * Sets the user name of this shopping cart.
253            *
254            * @param userName the user name of this shopping cart
255            */
256            public void setUserName(java.lang.String userName) {
257                    _shoppingCart.setUserName(userName);
258            }
259    
260            /**
261            * Returns the create date of this shopping cart.
262            *
263            * @return the create date of this shopping cart
264            */
265            public java.util.Date getCreateDate() {
266                    return _shoppingCart.getCreateDate();
267            }
268    
269            /**
270            * Sets the create date of this shopping cart.
271            *
272            * @param createDate the create date of this shopping cart
273            */
274            public void setCreateDate(java.util.Date createDate) {
275                    _shoppingCart.setCreateDate(createDate);
276            }
277    
278            /**
279            * Returns the modified date of this shopping cart.
280            *
281            * @return the modified date of this shopping cart
282            */
283            public java.util.Date getModifiedDate() {
284                    return _shoppingCart.getModifiedDate();
285            }
286    
287            /**
288            * Sets the modified date of this shopping cart.
289            *
290            * @param modifiedDate the modified date of this shopping cart
291            */
292            public void setModifiedDate(java.util.Date modifiedDate) {
293                    _shoppingCart.setModifiedDate(modifiedDate);
294            }
295    
296            /**
297            * Returns the item IDs of this shopping cart.
298            *
299            * @return the item IDs of this shopping cart
300            */
301            public java.lang.String getItemIds() {
302                    return _shoppingCart.getItemIds();
303            }
304    
305            /**
306            * Sets the item IDs of this shopping cart.
307            *
308            * @param itemIds the item IDs of this shopping cart
309            */
310            public void setItemIds(java.lang.String itemIds) {
311                    _shoppingCart.setItemIds(itemIds);
312            }
313    
314            /**
315            * Returns the coupon codes of this shopping cart.
316            *
317            * @return the coupon codes of this shopping cart
318            */
319            public java.lang.String getCouponCodes() {
320                    return _shoppingCart.getCouponCodes();
321            }
322    
323            /**
324            * Sets the coupon codes of this shopping cart.
325            *
326            * @param couponCodes the coupon codes of this shopping cart
327            */
328            public void setCouponCodes(java.lang.String couponCodes) {
329                    _shoppingCart.setCouponCodes(couponCodes);
330            }
331    
332            /**
333            * Returns the alt shipping of this shopping cart.
334            *
335            * @return the alt shipping of this shopping cart
336            */
337            public int getAltShipping() {
338                    return _shoppingCart.getAltShipping();
339            }
340    
341            /**
342            * Sets the alt shipping of this shopping cart.
343            *
344            * @param altShipping the alt shipping of this shopping cart
345            */
346            public void setAltShipping(int altShipping) {
347                    _shoppingCart.setAltShipping(altShipping);
348            }
349    
350            /**
351            * Returns the insure of this shopping cart.
352            *
353            * @return the insure of this shopping cart
354            */
355            public boolean getInsure() {
356                    return _shoppingCart.getInsure();
357            }
358    
359            /**
360            * Returns <code>true</code> if this shopping cart is insure.
361            *
362            * @return <code>true</code> if this shopping cart is insure; <code>false</code> otherwise
363            */
364            public boolean isInsure() {
365                    return _shoppingCart.isInsure();
366            }
367    
368            /**
369            * Sets whether this shopping cart is insure.
370            *
371            * @param insure the insure of this shopping cart
372            */
373            public void setInsure(boolean insure) {
374                    _shoppingCart.setInsure(insure);
375            }
376    
377            public boolean isNew() {
378                    return _shoppingCart.isNew();
379            }
380    
381            public void setNew(boolean n) {
382                    _shoppingCart.setNew(n);
383            }
384    
385            public boolean isCachedModel() {
386                    return _shoppingCart.isCachedModel();
387            }
388    
389            public void setCachedModel(boolean cachedModel) {
390                    _shoppingCart.setCachedModel(cachedModel);
391            }
392    
393            public boolean isEscapedModel() {
394                    return _shoppingCart.isEscapedModel();
395            }
396    
397            public java.io.Serializable getPrimaryKeyObj() {
398                    return _shoppingCart.getPrimaryKeyObj();
399            }
400    
401            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
402                    _shoppingCart.setPrimaryKeyObj(primaryKeyObj);
403            }
404    
405            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
406                    return _shoppingCart.getExpandoBridge();
407            }
408    
409            public void setExpandoBridgeAttributes(
410                    com.liferay.portal.service.ServiceContext serviceContext) {
411                    _shoppingCart.setExpandoBridgeAttributes(serviceContext);
412            }
413    
414            @Override
415            public java.lang.Object clone() {
416                    return new ShoppingCartWrapper((ShoppingCart)_shoppingCart.clone());
417            }
418    
419            public int compareTo(
420                    com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) {
421                    return _shoppingCart.compareTo(shoppingCart);
422            }
423    
424            @Override
425            public int hashCode() {
426                    return _shoppingCart.hashCode();
427            }
428    
429            public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingCart> toCacheModel() {
430                    return _shoppingCart.toCacheModel();
431            }
432    
433            public com.liferay.portlet.shopping.model.ShoppingCart toEscapedModel() {
434                    return new ShoppingCartWrapper(_shoppingCart.toEscapedModel());
435            }
436    
437            public com.liferay.portlet.shopping.model.ShoppingCart toUnescapedModel() {
438                    return new ShoppingCartWrapper(_shoppingCart.toUnescapedModel());
439            }
440    
441            @Override
442            public java.lang.String toString() {
443                    return _shoppingCart.toString();
444            }
445    
446            public java.lang.String toXmlString() {
447                    return _shoppingCart.toXmlString();
448            }
449    
450            public void persist()
451                    throws com.liferay.portal.kernel.exception.SystemException {
452                    _shoppingCart.persist();
453            }
454    
455            public void addItemId(long itemId, java.lang.String fields) {
456                    _shoppingCart.addItemId(itemId, fields);
457            }
458    
459            public com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon()
460                    throws com.liferay.portal.kernel.exception.PortalException,
461                            com.liferay.portal.kernel.exception.SystemException {
462                    return _shoppingCart.getCoupon();
463            }
464    
465            public java.util.Map<com.liferay.portlet.shopping.model.ShoppingCartItem, java.lang.Integer> getItems()
466                    throws com.liferay.portal.kernel.exception.SystemException {
467                    return _shoppingCart.getItems();
468            }
469    
470            public int getItemsSize() {
471                    return _shoppingCart.getItemsSize();
472            }
473    
474            /**
475             * @deprecated Renamed to {@link #getWrappedModel}
476             */
477            public ShoppingCart getWrappedShoppingCart() {
478                    return _shoppingCart;
479            }
480    
481            public ShoppingCart getWrappedModel() {
482                    return _shoppingCart;
483            }
484    
485            public void resetOriginalValues() {
486                    _shoppingCart.resetOriginalValues();
487            }
488    
489            private ShoppingCart _shoppingCart;
490    }