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