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