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.portal.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
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 Subscription}.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see Subscription
030     * @generated
031     */
032    public class SubscriptionWrapper implements Subscription,
033            ModelWrapper<Subscription> {
034            public SubscriptionWrapper(Subscription subscription) {
035                    _subscription = subscription;
036            }
037    
038            @Override
039            public Class<?> getModelClass() {
040                    return Subscription.class;
041            }
042    
043            @Override
044            public String getModelClassName() {
045                    return Subscription.class.getName();
046            }
047    
048            @Override
049            public Map<String, Object> getModelAttributes() {
050                    Map<String, Object> attributes = new HashMap<String, Object>();
051    
052                    attributes.put("subscriptionId", getSubscriptionId());
053                    attributes.put("companyId", getCompanyId());
054                    attributes.put("userId", getUserId());
055                    attributes.put("userName", getUserName());
056                    attributes.put("createDate", getCreateDate());
057                    attributes.put("modifiedDate", getModifiedDate());
058                    attributes.put("classNameId", getClassNameId());
059                    attributes.put("classPK", getClassPK());
060                    attributes.put("frequency", getFrequency());
061    
062                    return attributes;
063            }
064    
065            @Override
066            public void setModelAttributes(Map<String, Object> attributes) {
067                    Long subscriptionId = (Long)attributes.get("subscriptionId");
068    
069                    if (subscriptionId != null) {
070                            setSubscriptionId(subscriptionId);
071                    }
072    
073                    Long companyId = (Long)attributes.get("companyId");
074    
075                    if (companyId != null) {
076                            setCompanyId(companyId);
077                    }
078    
079                    Long userId = (Long)attributes.get("userId");
080    
081                    if (userId != null) {
082                            setUserId(userId);
083                    }
084    
085                    String userName = (String)attributes.get("userName");
086    
087                    if (userName != null) {
088                            setUserName(userName);
089                    }
090    
091                    Date createDate = (Date)attributes.get("createDate");
092    
093                    if (createDate != null) {
094                            setCreateDate(createDate);
095                    }
096    
097                    Date modifiedDate = (Date)attributes.get("modifiedDate");
098    
099                    if (modifiedDate != null) {
100                            setModifiedDate(modifiedDate);
101                    }
102    
103                    Long classNameId = (Long)attributes.get("classNameId");
104    
105                    if (classNameId != null) {
106                            setClassNameId(classNameId);
107                    }
108    
109                    Long classPK = (Long)attributes.get("classPK");
110    
111                    if (classPK != null) {
112                            setClassPK(classPK);
113                    }
114    
115                    String frequency = (String)attributes.get("frequency");
116    
117                    if (frequency != null) {
118                            setFrequency(frequency);
119                    }
120            }
121    
122            /**
123            * Returns the primary key of this subscription.
124            *
125            * @return the primary key of this subscription
126            */
127            @Override
128            public long getPrimaryKey() {
129                    return _subscription.getPrimaryKey();
130            }
131    
132            /**
133            * Sets the primary key of this subscription.
134            *
135            * @param primaryKey the primary key of this subscription
136            */
137            @Override
138            public void setPrimaryKey(long primaryKey) {
139                    _subscription.setPrimaryKey(primaryKey);
140            }
141    
142            /**
143            * Returns the subscription ID of this subscription.
144            *
145            * @return the subscription ID of this subscription
146            */
147            @Override
148            public long getSubscriptionId() {
149                    return _subscription.getSubscriptionId();
150            }
151    
152            /**
153            * Sets the subscription ID of this subscription.
154            *
155            * @param subscriptionId the subscription ID of this subscription
156            */
157            @Override
158            public void setSubscriptionId(long subscriptionId) {
159                    _subscription.setSubscriptionId(subscriptionId);
160            }
161    
162            /**
163            * Returns the company ID of this subscription.
164            *
165            * @return the company ID of this subscription
166            */
167            @Override
168            public long getCompanyId() {
169                    return _subscription.getCompanyId();
170            }
171    
172            /**
173            * Sets the company ID of this subscription.
174            *
175            * @param companyId the company ID of this subscription
176            */
177            @Override
178            public void setCompanyId(long companyId) {
179                    _subscription.setCompanyId(companyId);
180            }
181    
182            /**
183            * Returns the user ID of this subscription.
184            *
185            * @return the user ID of this subscription
186            */
187            @Override
188            public long getUserId() {
189                    return _subscription.getUserId();
190            }
191    
192            /**
193            * Sets the user ID of this subscription.
194            *
195            * @param userId the user ID of this subscription
196            */
197            @Override
198            public void setUserId(long userId) {
199                    _subscription.setUserId(userId);
200            }
201    
202            /**
203            * Returns the user uuid of this subscription.
204            *
205            * @return the user uuid of this subscription
206            * @throws SystemException if a system exception occurred
207            */
208            @Override
209            public java.lang.String getUserUuid()
210                    throws com.liferay.portal.kernel.exception.SystemException {
211                    return _subscription.getUserUuid();
212            }
213    
214            /**
215            * Sets the user uuid of this subscription.
216            *
217            * @param userUuid the user uuid of this subscription
218            */
219            @Override
220            public void setUserUuid(java.lang.String userUuid) {
221                    _subscription.setUserUuid(userUuid);
222            }
223    
224            /**
225            * Returns the user name of this subscription.
226            *
227            * @return the user name of this subscription
228            */
229            @Override
230            public java.lang.String getUserName() {
231                    return _subscription.getUserName();
232            }
233    
234            /**
235            * Sets the user name of this subscription.
236            *
237            * @param userName the user name of this subscription
238            */
239            @Override
240            public void setUserName(java.lang.String userName) {
241                    _subscription.setUserName(userName);
242            }
243    
244            /**
245            * Returns the create date of this subscription.
246            *
247            * @return the create date of this subscription
248            */
249            @Override
250            public java.util.Date getCreateDate() {
251                    return _subscription.getCreateDate();
252            }
253    
254            /**
255            * Sets the create date of this subscription.
256            *
257            * @param createDate the create date of this subscription
258            */
259            @Override
260            public void setCreateDate(java.util.Date createDate) {
261                    _subscription.setCreateDate(createDate);
262            }
263    
264            /**
265            * Returns the modified date of this subscription.
266            *
267            * @return the modified date of this subscription
268            */
269            @Override
270            public java.util.Date getModifiedDate() {
271                    return _subscription.getModifiedDate();
272            }
273    
274            /**
275            * Sets the modified date of this subscription.
276            *
277            * @param modifiedDate the modified date of this subscription
278            */
279            @Override
280            public void setModifiedDate(java.util.Date modifiedDate) {
281                    _subscription.setModifiedDate(modifiedDate);
282            }
283    
284            /**
285            * Returns the fully qualified class name of this subscription.
286            *
287            * @return the fully qualified class name of this subscription
288            */
289            @Override
290            public java.lang.String getClassName() {
291                    return _subscription.getClassName();
292            }
293    
294            @Override
295            public void setClassName(java.lang.String className) {
296                    _subscription.setClassName(className);
297            }
298    
299            /**
300            * Returns the class name ID of this subscription.
301            *
302            * @return the class name ID of this subscription
303            */
304            @Override
305            public long getClassNameId() {
306                    return _subscription.getClassNameId();
307            }
308    
309            /**
310            * Sets the class name ID of this subscription.
311            *
312            * @param classNameId the class name ID of this subscription
313            */
314            @Override
315            public void setClassNameId(long classNameId) {
316                    _subscription.setClassNameId(classNameId);
317            }
318    
319            /**
320            * Returns the class p k of this subscription.
321            *
322            * @return the class p k of this subscription
323            */
324            @Override
325            public long getClassPK() {
326                    return _subscription.getClassPK();
327            }
328    
329            /**
330            * Sets the class p k of this subscription.
331            *
332            * @param classPK the class p k of this subscription
333            */
334            @Override
335            public void setClassPK(long classPK) {
336                    _subscription.setClassPK(classPK);
337            }
338    
339            /**
340            * Returns the frequency of this subscription.
341            *
342            * @return the frequency of this subscription
343            */
344            @Override
345            public java.lang.String getFrequency() {
346                    return _subscription.getFrequency();
347            }
348    
349            /**
350            * Sets the frequency of this subscription.
351            *
352            * @param frequency the frequency of this subscription
353            */
354            @Override
355            public void setFrequency(java.lang.String frequency) {
356                    _subscription.setFrequency(frequency);
357            }
358    
359            @Override
360            public boolean isNew() {
361                    return _subscription.isNew();
362            }
363    
364            @Override
365            public void setNew(boolean n) {
366                    _subscription.setNew(n);
367            }
368    
369            @Override
370            public boolean isCachedModel() {
371                    return _subscription.isCachedModel();
372            }
373    
374            @Override
375            public void setCachedModel(boolean cachedModel) {
376                    _subscription.setCachedModel(cachedModel);
377            }
378    
379            @Override
380            public boolean isEscapedModel() {
381                    return _subscription.isEscapedModel();
382            }
383    
384            @Override
385            public java.io.Serializable getPrimaryKeyObj() {
386                    return _subscription.getPrimaryKeyObj();
387            }
388    
389            @Override
390            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
391                    _subscription.setPrimaryKeyObj(primaryKeyObj);
392            }
393    
394            @Override
395            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
396                    return _subscription.getExpandoBridge();
397            }
398    
399            @Override
400            public void setExpandoBridgeAttributes(
401                    com.liferay.portal.model.BaseModel<?> baseModel) {
402                    _subscription.setExpandoBridgeAttributes(baseModel);
403            }
404    
405            @Override
406            public void setExpandoBridgeAttributes(
407                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
408                    _subscription.setExpandoBridgeAttributes(expandoBridge);
409            }
410    
411            @Override
412            public void setExpandoBridgeAttributes(
413                    com.liferay.portal.service.ServiceContext serviceContext) {
414                    _subscription.setExpandoBridgeAttributes(serviceContext);
415            }
416    
417            @Override
418            public java.lang.Object clone() {
419                    return new SubscriptionWrapper((Subscription)_subscription.clone());
420            }
421    
422            @Override
423            public int compareTo(com.liferay.portal.model.Subscription subscription) {
424                    return _subscription.compareTo(subscription);
425            }
426    
427            @Override
428            public int hashCode() {
429                    return _subscription.hashCode();
430            }
431    
432            @Override
433            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Subscription> toCacheModel() {
434                    return _subscription.toCacheModel();
435            }
436    
437            @Override
438            public com.liferay.portal.model.Subscription toEscapedModel() {
439                    return new SubscriptionWrapper(_subscription.toEscapedModel());
440            }
441    
442            @Override
443            public com.liferay.portal.model.Subscription toUnescapedModel() {
444                    return new SubscriptionWrapper(_subscription.toUnescapedModel());
445            }
446    
447            @Override
448            public java.lang.String toString() {
449                    return _subscription.toString();
450            }
451    
452            @Override
453            public java.lang.String toXmlString() {
454                    return _subscription.toXmlString();
455            }
456    
457            @Override
458            public void persist()
459                    throws com.liferay.portal.kernel.exception.SystemException {
460                    _subscription.persist();
461            }
462    
463            @Override
464            public boolean equals(Object obj) {
465                    if (this == obj) {
466                            return true;
467                    }
468    
469                    if (!(obj instanceof SubscriptionWrapper)) {
470                            return false;
471                    }
472    
473                    SubscriptionWrapper subscriptionWrapper = (SubscriptionWrapper)obj;
474    
475                    if (Validator.equals(_subscription, subscriptionWrapper._subscription)) {
476                            return true;
477                    }
478    
479                    return false;
480            }
481    
482            /**
483             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
484             */
485            public Subscription getWrappedSubscription() {
486                    return _subscription;
487            }
488    
489            @Override
490            public Subscription getWrappedModel() {
491                    return _subscription;
492            }
493    
494            @Override
495            public void resetOriginalValues() {
496                    _subscription.resetOriginalValues();
497            }
498    
499            private Subscription _subscription;
500    }