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