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