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