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