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