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