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 ShoppingCoupon}.
027     * </p>
028     *
029     * @author    Brian Wing Shun Chan
030     * @see       ShoppingCoupon
031     * @generated
032     */
033    public class ShoppingCouponWrapper implements ShoppingCoupon,
034            ModelWrapper<ShoppingCoupon> {
035            public ShoppingCouponWrapper(ShoppingCoupon shoppingCoupon) {
036                    _shoppingCoupon = shoppingCoupon;
037            }
038    
039            public Class<?> getModelClass() {
040                    return ShoppingCoupon.class;
041            }
042    
043            public String getModelClassName() {
044                    return ShoppingCoupon.class.getName();
045            }
046    
047            public Map<String, Object> getModelAttributes() {
048                    Map<String, Object> attributes = new HashMap<String, Object>();
049    
050                    attributes.put("couponId", getCouponId());
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("code", getCode());
058                    attributes.put("name", getName());
059                    attributes.put("description", getDescription());
060                    attributes.put("startDate", getStartDate());
061                    attributes.put("endDate", getEndDate());
062                    attributes.put("active", getActive());
063                    attributes.put("limitCategories", getLimitCategories());
064                    attributes.put("limitSkus", getLimitSkus());
065                    attributes.put("minOrder", getMinOrder());
066                    attributes.put("discount", getDiscount());
067                    attributes.put("discountType", getDiscountType());
068    
069                    return attributes;
070            }
071    
072            public void setModelAttributes(Map<String, Object> attributes) {
073                    Long couponId = (Long)attributes.get("couponId");
074    
075                    if (couponId != null) {
076                            setCouponId(couponId);
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 code = (String)attributes.get("code");
116    
117                    if (code != null) {
118                            setCode(code);
119                    }
120    
121                    String name = (String)attributes.get("name");
122    
123                    if (name != null) {
124                            setName(name);
125                    }
126    
127                    String description = (String)attributes.get("description");
128    
129                    if (description != null) {
130                            setDescription(description);
131                    }
132    
133                    Date startDate = (Date)attributes.get("startDate");
134    
135                    if (startDate != null) {
136                            setStartDate(startDate);
137                    }
138    
139                    Date endDate = (Date)attributes.get("endDate");
140    
141                    if (endDate != null) {
142                            setEndDate(endDate);
143                    }
144    
145                    Boolean active = (Boolean)attributes.get("active");
146    
147                    if (active != null) {
148                            setActive(active);
149                    }
150    
151                    String limitCategories = (String)attributes.get("limitCategories");
152    
153                    if (limitCategories != null) {
154                            setLimitCategories(limitCategories);
155                    }
156    
157                    String limitSkus = (String)attributes.get("limitSkus");
158    
159                    if (limitSkus != null) {
160                            setLimitSkus(limitSkus);
161                    }
162    
163                    Double minOrder = (Double)attributes.get("minOrder");
164    
165                    if (minOrder != null) {
166                            setMinOrder(minOrder);
167                    }
168    
169                    Double discount = (Double)attributes.get("discount");
170    
171                    if (discount != null) {
172                            setDiscount(discount);
173                    }
174    
175                    String discountType = (String)attributes.get("discountType");
176    
177                    if (discountType != null) {
178                            setDiscountType(discountType);
179                    }
180            }
181    
182            /**
183            * Returns the primary key of this shopping coupon.
184            *
185            * @return the primary key of this shopping coupon
186            */
187            public long getPrimaryKey() {
188                    return _shoppingCoupon.getPrimaryKey();
189            }
190    
191            /**
192            * Sets the primary key of this shopping coupon.
193            *
194            * @param primaryKey the primary key of this shopping coupon
195            */
196            public void setPrimaryKey(long primaryKey) {
197                    _shoppingCoupon.setPrimaryKey(primaryKey);
198            }
199    
200            /**
201            * Returns the coupon ID of this shopping coupon.
202            *
203            * @return the coupon ID of this shopping coupon
204            */
205            public long getCouponId() {
206                    return _shoppingCoupon.getCouponId();
207            }
208    
209            /**
210            * Sets the coupon ID of this shopping coupon.
211            *
212            * @param couponId the coupon ID of this shopping coupon
213            */
214            public void setCouponId(long couponId) {
215                    _shoppingCoupon.setCouponId(couponId);
216            }
217    
218            /**
219            * Returns the group ID of this shopping coupon.
220            *
221            * @return the group ID of this shopping coupon
222            */
223            public long getGroupId() {
224                    return _shoppingCoupon.getGroupId();
225            }
226    
227            /**
228            * Sets the group ID of this shopping coupon.
229            *
230            * @param groupId the group ID of this shopping coupon
231            */
232            public void setGroupId(long groupId) {
233                    _shoppingCoupon.setGroupId(groupId);
234            }
235    
236            /**
237            * Returns the company ID of this shopping coupon.
238            *
239            * @return the company ID of this shopping coupon
240            */
241            public long getCompanyId() {
242                    return _shoppingCoupon.getCompanyId();
243            }
244    
245            /**
246            * Sets the company ID of this shopping coupon.
247            *
248            * @param companyId the company ID of this shopping coupon
249            */
250            public void setCompanyId(long companyId) {
251                    _shoppingCoupon.setCompanyId(companyId);
252            }
253    
254            /**
255            * Returns the user ID of this shopping coupon.
256            *
257            * @return the user ID of this shopping coupon
258            */
259            public long getUserId() {
260                    return _shoppingCoupon.getUserId();
261            }
262    
263            /**
264            * Sets the user ID of this shopping coupon.
265            *
266            * @param userId the user ID of this shopping coupon
267            */
268            public void setUserId(long userId) {
269                    _shoppingCoupon.setUserId(userId);
270            }
271    
272            /**
273            * Returns the user uuid of this shopping coupon.
274            *
275            * @return the user uuid of this shopping coupon
276            * @throws SystemException if a system exception occurred
277            */
278            public java.lang.String getUserUuid()
279                    throws com.liferay.portal.kernel.exception.SystemException {
280                    return _shoppingCoupon.getUserUuid();
281            }
282    
283            /**
284            * Sets the user uuid of this shopping coupon.
285            *
286            * @param userUuid the user uuid of this shopping coupon
287            */
288            public void setUserUuid(java.lang.String userUuid) {
289                    _shoppingCoupon.setUserUuid(userUuid);
290            }
291    
292            /**
293            * Returns the user name of this shopping coupon.
294            *
295            * @return the user name of this shopping coupon
296            */
297            public java.lang.String getUserName() {
298                    return _shoppingCoupon.getUserName();
299            }
300    
301            /**
302            * Sets the user name of this shopping coupon.
303            *
304            * @param userName the user name of this shopping coupon
305            */
306            public void setUserName(java.lang.String userName) {
307                    _shoppingCoupon.setUserName(userName);
308            }
309    
310            /**
311            * Returns the create date of this shopping coupon.
312            *
313            * @return the create date of this shopping coupon
314            */
315            public java.util.Date getCreateDate() {
316                    return _shoppingCoupon.getCreateDate();
317            }
318    
319            /**
320            * Sets the create date of this shopping coupon.
321            *
322            * @param createDate the create date of this shopping coupon
323            */
324            public void setCreateDate(java.util.Date createDate) {
325                    _shoppingCoupon.setCreateDate(createDate);
326            }
327    
328            /**
329            * Returns the modified date of this shopping coupon.
330            *
331            * @return the modified date of this shopping coupon
332            */
333            public java.util.Date getModifiedDate() {
334                    return _shoppingCoupon.getModifiedDate();
335            }
336    
337            /**
338            * Sets the modified date of this shopping coupon.
339            *
340            * @param modifiedDate the modified date of this shopping coupon
341            */
342            public void setModifiedDate(java.util.Date modifiedDate) {
343                    _shoppingCoupon.setModifiedDate(modifiedDate);
344            }
345    
346            /**
347            * Returns the code of this shopping coupon.
348            *
349            * @return the code of this shopping coupon
350            */
351            public java.lang.String getCode() {
352                    return _shoppingCoupon.getCode();
353            }
354    
355            /**
356            * Sets the code of this shopping coupon.
357            *
358            * @param code the code of this shopping coupon
359            */
360            public void setCode(java.lang.String code) {
361                    _shoppingCoupon.setCode(code);
362            }
363    
364            /**
365            * Returns the name of this shopping coupon.
366            *
367            * @return the name of this shopping coupon
368            */
369            public java.lang.String getName() {
370                    return _shoppingCoupon.getName();
371            }
372    
373            /**
374            * Sets the name of this shopping coupon.
375            *
376            * @param name the name of this shopping coupon
377            */
378            public void setName(java.lang.String name) {
379                    _shoppingCoupon.setName(name);
380            }
381    
382            /**
383            * Returns the description of this shopping coupon.
384            *
385            * @return the description of this shopping coupon
386            */
387            public java.lang.String getDescription() {
388                    return _shoppingCoupon.getDescription();
389            }
390    
391            /**
392            * Sets the description of this shopping coupon.
393            *
394            * @param description the description of this shopping coupon
395            */
396            public void setDescription(java.lang.String description) {
397                    _shoppingCoupon.setDescription(description);
398            }
399    
400            /**
401            * Returns the start date of this shopping coupon.
402            *
403            * @return the start date of this shopping coupon
404            */
405            public java.util.Date getStartDate() {
406                    return _shoppingCoupon.getStartDate();
407            }
408    
409            /**
410            * Sets the start date of this shopping coupon.
411            *
412            * @param startDate the start date of this shopping coupon
413            */
414            public void setStartDate(java.util.Date startDate) {
415                    _shoppingCoupon.setStartDate(startDate);
416            }
417    
418            /**
419            * Returns the end date of this shopping coupon.
420            *
421            * @return the end date of this shopping coupon
422            */
423            public java.util.Date getEndDate() {
424                    return _shoppingCoupon.getEndDate();
425            }
426    
427            /**
428            * Sets the end date of this shopping coupon.
429            *
430            * @param endDate the end date of this shopping coupon
431            */
432            public void setEndDate(java.util.Date endDate) {
433                    _shoppingCoupon.setEndDate(endDate);
434            }
435    
436            /**
437            * Returns the active of this shopping coupon.
438            *
439            * @return the active of this shopping coupon
440            */
441            public boolean getActive() {
442                    return _shoppingCoupon.getActive();
443            }
444    
445            /**
446            * Returns <code>true</code> if this shopping coupon is active.
447            *
448            * @return <code>true</code> if this shopping coupon is active; <code>false</code> otherwise
449            */
450            public boolean isActive() {
451                    return _shoppingCoupon.isActive();
452            }
453    
454            /**
455            * Sets whether this shopping coupon is active.
456            *
457            * @param active the active of this shopping coupon
458            */
459            public void setActive(boolean active) {
460                    _shoppingCoupon.setActive(active);
461            }
462    
463            /**
464            * Returns the limit categories of this shopping coupon.
465            *
466            * @return the limit categories of this shopping coupon
467            */
468            public java.lang.String getLimitCategories() {
469                    return _shoppingCoupon.getLimitCategories();
470            }
471    
472            /**
473            * Sets the limit categories of this shopping coupon.
474            *
475            * @param limitCategories the limit categories of this shopping coupon
476            */
477            public void setLimitCategories(java.lang.String limitCategories) {
478                    _shoppingCoupon.setLimitCategories(limitCategories);
479            }
480    
481            /**
482            * Returns the limit skus of this shopping coupon.
483            *
484            * @return the limit skus of this shopping coupon
485            */
486            public java.lang.String getLimitSkus() {
487                    return _shoppingCoupon.getLimitSkus();
488            }
489    
490            /**
491            * Sets the limit skus of this shopping coupon.
492            *
493            * @param limitSkus the limit skus of this shopping coupon
494            */
495            public void setLimitSkus(java.lang.String limitSkus) {
496                    _shoppingCoupon.setLimitSkus(limitSkus);
497            }
498    
499            /**
500            * Returns the min order of this shopping coupon.
501            *
502            * @return the min order of this shopping coupon
503            */
504            public double getMinOrder() {
505                    return _shoppingCoupon.getMinOrder();
506            }
507    
508            /**
509            * Sets the min order of this shopping coupon.
510            *
511            * @param minOrder the min order of this shopping coupon
512            */
513            public void setMinOrder(double minOrder) {
514                    _shoppingCoupon.setMinOrder(minOrder);
515            }
516    
517            /**
518            * Returns the discount of this shopping coupon.
519            *
520            * @return the discount of this shopping coupon
521            */
522            public double getDiscount() {
523                    return _shoppingCoupon.getDiscount();
524            }
525    
526            /**
527            * Sets the discount of this shopping coupon.
528            *
529            * @param discount the discount of this shopping coupon
530            */
531            public void setDiscount(double discount) {
532                    _shoppingCoupon.setDiscount(discount);
533            }
534    
535            /**
536            * Returns the discount type of this shopping coupon.
537            *
538            * @return the discount type of this shopping coupon
539            */
540            public java.lang.String getDiscountType() {
541                    return _shoppingCoupon.getDiscountType();
542            }
543    
544            /**
545            * Sets the discount type of this shopping coupon.
546            *
547            * @param discountType the discount type of this shopping coupon
548            */
549            public void setDiscountType(java.lang.String discountType) {
550                    _shoppingCoupon.setDiscountType(discountType);
551            }
552    
553            public boolean isNew() {
554                    return _shoppingCoupon.isNew();
555            }
556    
557            public void setNew(boolean n) {
558                    _shoppingCoupon.setNew(n);
559            }
560    
561            public boolean isCachedModel() {
562                    return _shoppingCoupon.isCachedModel();
563            }
564    
565            public void setCachedModel(boolean cachedModel) {
566                    _shoppingCoupon.setCachedModel(cachedModel);
567            }
568    
569            public boolean isEscapedModel() {
570                    return _shoppingCoupon.isEscapedModel();
571            }
572    
573            public java.io.Serializable getPrimaryKeyObj() {
574                    return _shoppingCoupon.getPrimaryKeyObj();
575            }
576    
577            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
578                    _shoppingCoupon.setPrimaryKeyObj(primaryKeyObj);
579            }
580    
581            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
582                    return _shoppingCoupon.getExpandoBridge();
583            }
584    
585            public void setExpandoBridgeAttributes(
586                    com.liferay.portal.service.ServiceContext serviceContext) {
587                    _shoppingCoupon.setExpandoBridgeAttributes(serviceContext);
588            }
589    
590            @Override
591            public java.lang.Object clone() {
592                    return new ShoppingCouponWrapper((ShoppingCoupon)_shoppingCoupon.clone());
593            }
594    
595            public int compareTo(
596                    com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon) {
597                    return _shoppingCoupon.compareTo(shoppingCoupon);
598            }
599    
600            @Override
601            public int hashCode() {
602                    return _shoppingCoupon.hashCode();
603            }
604    
605            public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingCoupon> toCacheModel() {
606                    return _shoppingCoupon.toCacheModel();
607            }
608    
609            public com.liferay.portlet.shopping.model.ShoppingCoupon toEscapedModel() {
610                    return new ShoppingCouponWrapper(_shoppingCoupon.toEscapedModel());
611            }
612    
613            public com.liferay.portlet.shopping.model.ShoppingCoupon toUnescapedModel() {
614                    return new ShoppingCouponWrapper(_shoppingCoupon.toUnescapedModel());
615            }
616    
617            @Override
618            public java.lang.String toString() {
619                    return _shoppingCoupon.toString();
620            }
621    
622            public java.lang.String toXmlString() {
623                    return _shoppingCoupon.toXmlString();
624            }
625    
626            public void persist()
627                    throws com.liferay.portal.kernel.exception.SystemException {
628                    _shoppingCoupon.persist();
629            }
630    
631            public boolean hasValidDateRange() {
632                    return _shoppingCoupon.hasValidDateRange();
633            }
634    
635            public boolean hasValidEndDate() {
636                    return _shoppingCoupon.hasValidEndDate();
637            }
638    
639            public boolean hasValidStartDate() {
640                    return _shoppingCoupon.hasValidStartDate();
641            }
642    
643            @Override
644            public boolean equals(Object obj) {
645                    if (this == obj) {
646                            return true;
647                    }
648    
649                    if (!(obj instanceof ShoppingCouponWrapper)) {
650                            return false;
651                    }
652    
653                    ShoppingCouponWrapper shoppingCouponWrapper = (ShoppingCouponWrapper)obj;
654    
655                    if (Validator.equals(_shoppingCoupon,
656                                            shoppingCouponWrapper._shoppingCoupon)) {
657                            return true;
658                    }
659    
660                    return false;
661            }
662    
663            /**
664             * @deprecated Renamed to {@link #getWrappedModel}
665             */
666            public ShoppingCoupon getWrappedShoppingCoupon() {
667                    return _shoppingCoupon;
668            }
669    
670            public ShoppingCoupon getWrappedModel() {
671                    return _shoppingCoupon;
672            }
673    
674            public void resetOriginalValues() {
675                    _shoppingCoupon.resetOriginalValues();
676            }
677    
678            private ShoppingCoupon _shoppingCoupon;
679    }