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