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