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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.service.ServiceContext;
022    import com.liferay.portal.kernel.util.Validator;
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(
151                    com.liferay.portal.kernel.model.Subscription subscription) {
152                    return _subscription.compareTo(subscription);
153            }
154    
155            /**
156            * Returns the fully qualified class name of this subscription.
157            *
158            * @return the fully qualified class name of this subscription
159            */
160            @Override
161            public java.lang.String getClassName() {
162                    return _subscription.getClassName();
163            }
164    
165            /**
166            * Returns the class name ID of this subscription.
167            *
168            * @return the class name ID of this subscription
169            */
170            @Override
171            public long getClassNameId() {
172                    return _subscription.getClassNameId();
173            }
174    
175            /**
176            * Returns the class p k of this subscription.
177            *
178            * @return the class p k of this subscription
179            */
180            @Override
181            public long getClassPK() {
182                    return _subscription.getClassPK();
183            }
184    
185            /**
186            * Returns the company ID of this subscription.
187            *
188            * @return the company ID of this subscription
189            */
190            @Override
191            public long getCompanyId() {
192                    return _subscription.getCompanyId();
193            }
194    
195            /**
196            * Returns the create date of this subscription.
197            *
198            * @return the create date of this subscription
199            */
200            @Override
201            public Date getCreateDate() {
202                    return _subscription.getCreateDate();
203            }
204    
205            @Override
206            public ExpandoBridge getExpandoBridge() {
207                    return _subscription.getExpandoBridge();
208            }
209    
210            /**
211            * Returns the frequency of this subscription.
212            *
213            * @return the frequency of this subscription
214            */
215            @Override
216            public java.lang.String getFrequency() {
217                    return _subscription.getFrequency();
218            }
219    
220            /**
221            * Returns the group ID of this subscription.
222            *
223            * @return the group ID of this subscription
224            */
225            @Override
226            public long getGroupId() {
227                    return _subscription.getGroupId();
228            }
229    
230            /**
231            * Returns the modified date of this subscription.
232            *
233            * @return the modified date of this subscription
234            */
235            @Override
236            public Date getModifiedDate() {
237                    return _subscription.getModifiedDate();
238            }
239    
240            /**
241            * Returns the mvcc version of this subscription.
242            *
243            * @return the mvcc version of this subscription
244            */
245            @Override
246            public long getMvccVersion() {
247                    return _subscription.getMvccVersion();
248            }
249    
250            /**
251            * Returns the primary key of this subscription.
252            *
253            * @return the primary key of this subscription
254            */
255            @Override
256            public long getPrimaryKey() {
257                    return _subscription.getPrimaryKey();
258            }
259    
260            @Override
261            public Serializable getPrimaryKeyObj() {
262                    return _subscription.getPrimaryKeyObj();
263            }
264    
265            /**
266            * Returns the subscription ID of this subscription.
267            *
268            * @return the subscription ID of this subscription
269            */
270            @Override
271            public long getSubscriptionId() {
272                    return _subscription.getSubscriptionId();
273            }
274    
275            /**
276            * Returns the user ID of this subscription.
277            *
278            * @return the user ID of this subscription
279            */
280            @Override
281            public long getUserId() {
282                    return _subscription.getUserId();
283            }
284    
285            /**
286            * Returns the user name of this subscription.
287            *
288            * @return the user name of this subscription
289            */
290            @Override
291            public java.lang.String getUserName() {
292                    return _subscription.getUserName();
293            }
294    
295            /**
296            * Returns the user uuid of this subscription.
297            *
298            * @return the user uuid of this subscription
299            */
300            @Override
301            public java.lang.String getUserUuid() {
302                    return _subscription.getUserUuid();
303            }
304    
305            @Override
306            public int hashCode() {
307                    return _subscription.hashCode();
308            }
309    
310            @Override
311            public boolean isCachedModel() {
312                    return _subscription.isCachedModel();
313            }
314    
315            @Override
316            public boolean isEscapedModel() {
317                    return _subscription.isEscapedModel();
318            }
319    
320            @Override
321            public boolean isNew() {
322                    return _subscription.isNew();
323            }
324    
325            @Override
326            public void persist() {
327                    _subscription.persist();
328            }
329    
330            @Override
331            public void setCachedModel(boolean cachedModel) {
332                    _subscription.setCachedModel(cachedModel);
333            }
334    
335            @Override
336            public void setClassName(java.lang.String className) {
337                    _subscription.setClassName(className);
338            }
339    
340            /**
341            * Sets the class name ID of this subscription.
342            *
343            * @param classNameId the class name ID of this subscription
344            */
345            @Override
346            public void setClassNameId(long classNameId) {
347                    _subscription.setClassNameId(classNameId);
348            }
349    
350            /**
351            * Sets the class p k of this subscription.
352            *
353            * @param classPK the class p k of this subscription
354            */
355            @Override
356            public void setClassPK(long classPK) {
357                    _subscription.setClassPK(classPK);
358            }
359    
360            /**
361            * Sets the company ID of this subscription.
362            *
363            * @param companyId the company ID of this subscription
364            */
365            @Override
366            public void setCompanyId(long companyId) {
367                    _subscription.setCompanyId(companyId);
368            }
369    
370            /**
371            * Sets the create date of this subscription.
372            *
373            * @param createDate the create date of this subscription
374            */
375            @Override
376            public void setCreateDate(Date createDate) {
377                    _subscription.setCreateDate(createDate);
378            }
379    
380            @Override
381            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
382                    _subscription.setExpandoBridgeAttributes(baseModel);
383            }
384    
385            @Override
386            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
387                    _subscription.setExpandoBridgeAttributes(expandoBridge);
388            }
389    
390            @Override
391            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
392                    _subscription.setExpandoBridgeAttributes(serviceContext);
393            }
394    
395            /**
396            * Sets the frequency of this subscription.
397            *
398            * @param frequency the frequency of this subscription
399            */
400            @Override
401            public void setFrequency(java.lang.String frequency) {
402                    _subscription.setFrequency(frequency);
403            }
404    
405            /**
406            * Sets the group ID of this subscription.
407            *
408            * @param groupId the group ID of this subscription
409            */
410            @Override
411            public void setGroupId(long groupId) {
412                    _subscription.setGroupId(groupId);
413            }
414    
415            /**
416            * Sets the modified date of this subscription.
417            *
418            * @param modifiedDate the modified date of this subscription
419            */
420            @Override
421            public void setModifiedDate(Date modifiedDate) {
422                    _subscription.setModifiedDate(modifiedDate);
423            }
424    
425            /**
426            * Sets the mvcc version of this subscription.
427            *
428            * @param mvccVersion the mvcc version of this subscription
429            */
430            @Override
431            public void setMvccVersion(long mvccVersion) {
432                    _subscription.setMvccVersion(mvccVersion);
433            }
434    
435            @Override
436            public void setNew(boolean n) {
437                    _subscription.setNew(n);
438            }
439    
440            /**
441            * Sets the primary key of this subscription.
442            *
443            * @param primaryKey the primary key of this subscription
444            */
445            @Override
446            public void setPrimaryKey(long primaryKey) {
447                    _subscription.setPrimaryKey(primaryKey);
448            }
449    
450            @Override
451            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
452                    _subscription.setPrimaryKeyObj(primaryKeyObj);
453            }
454    
455            /**
456            * Sets the subscription ID of this subscription.
457            *
458            * @param subscriptionId the subscription ID of this subscription
459            */
460            @Override
461            public void setSubscriptionId(long subscriptionId) {
462                    _subscription.setSubscriptionId(subscriptionId);
463            }
464    
465            /**
466            * Sets the user ID of this subscription.
467            *
468            * @param userId the user ID of this subscription
469            */
470            @Override
471            public void setUserId(long userId) {
472                    _subscription.setUserId(userId);
473            }
474    
475            /**
476            * Sets the user name of this subscription.
477            *
478            * @param userName the user name of this subscription
479            */
480            @Override
481            public void setUserName(java.lang.String userName) {
482                    _subscription.setUserName(userName);
483            }
484    
485            /**
486            * Sets the user uuid of this subscription.
487            *
488            * @param userUuid the user uuid of this subscription
489            */
490            @Override
491            public void setUserUuid(java.lang.String userUuid) {
492                    _subscription.setUserUuid(userUuid);
493            }
494    
495            @Override
496            public CacheModel<com.liferay.portal.kernel.model.Subscription> toCacheModel() {
497                    return _subscription.toCacheModel();
498            }
499    
500            @Override
501            public com.liferay.portal.kernel.model.Subscription toEscapedModel() {
502                    return new SubscriptionWrapper(_subscription.toEscapedModel());
503            }
504    
505            @Override
506            public java.lang.String toString() {
507                    return _subscription.toString();
508            }
509    
510            @Override
511            public com.liferay.portal.kernel.model.Subscription toUnescapedModel() {
512                    return new SubscriptionWrapper(_subscription.toUnescapedModel());
513            }
514    
515            @Override
516            public java.lang.String toXmlString() {
517                    return _subscription.toXmlString();
518            }
519    
520            @Override
521            public boolean equals(Object obj) {
522                    if (this == obj) {
523                            return true;
524                    }
525    
526                    if (!(obj instanceof SubscriptionWrapper)) {
527                            return false;
528                    }
529    
530                    SubscriptionWrapper subscriptionWrapper = (SubscriptionWrapper)obj;
531    
532                    if (Validator.equals(_subscription, subscriptionWrapper._subscription)) {
533                            return true;
534                    }
535    
536                    return false;
537            }
538    
539            @Override
540            public Subscription getWrappedModel() {
541                    return _subscription;
542            }
543    
544            @Override
545            public boolean isEntityCacheEnabled() {
546                    return _subscription.isEntityCacheEnabled();
547            }
548    
549            @Override
550            public boolean isFinderCacheEnabled() {
551                    return _subscription.isFinderCacheEnabled();
552            }
553    
554            @Override
555            public void resetOriginalValues() {
556                    _subscription.resetOriginalValues();
557            }
558    
559            private final Subscription _subscription;
560    }