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.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            @Override
113            public java.lang.Object clone() {
114                    return new AnnouncementsDeliveryWrapper((AnnouncementsDelivery)_announcementsDelivery.clone());
115            }
116    
117            @Override
118            public int compareTo(
119                    com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery) {
120                    return _announcementsDelivery.compareTo(announcementsDelivery);
121            }
122    
123            /**
124            * Returns the company ID of this announcements delivery.
125            *
126            * @return the company ID of this announcements delivery
127            */
128            @Override
129            public long getCompanyId() {
130                    return _announcementsDelivery.getCompanyId();
131            }
132    
133            /**
134            * Returns the delivery ID of this announcements delivery.
135            *
136            * @return the delivery ID of this announcements delivery
137            */
138            @Override
139            public long getDeliveryId() {
140                    return _announcementsDelivery.getDeliveryId();
141            }
142    
143            /**
144            * Returns the email of this announcements delivery.
145            *
146            * @return the email of this announcements delivery
147            */
148            @Override
149            public boolean getEmail() {
150                    return _announcementsDelivery.getEmail();
151            }
152    
153            @Override
154            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
155                    return _announcementsDelivery.getExpandoBridge();
156            }
157    
158            /**
159            * Returns the primary key of this announcements delivery.
160            *
161            * @return the primary key of this announcements delivery
162            */
163            @Override
164            public long getPrimaryKey() {
165                    return _announcementsDelivery.getPrimaryKey();
166            }
167    
168            @Override
169            public java.io.Serializable getPrimaryKeyObj() {
170                    return _announcementsDelivery.getPrimaryKeyObj();
171            }
172    
173            /**
174            * Returns the sms of this announcements delivery.
175            *
176            * @return the sms of this announcements delivery
177            */
178            @Override
179            public boolean getSms() {
180                    return _announcementsDelivery.getSms();
181            }
182    
183            /**
184            * Returns the type of this announcements delivery.
185            *
186            * @return the type of this announcements delivery
187            */
188            @Override
189            public java.lang.String getType() {
190                    return _announcementsDelivery.getType();
191            }
192    
193            /**
194            * Returns the user ID of this announcements delivery.
195            *
196            * @return the user ID of this announcements delivery
197            */
198            @Override
199            public long getUserId() {
200                    return _announcementsDelivery.getUserId();
201            }
202    
203            /**
204            * Returns the user uuid of this announcements delivery.
205            *
206            * @return the user uuid of this announcements delivery
207            */
208            @Override
209            public java.lang.String getUserUuid() {
210                    return _announcementsDelivery.getUserUuid();
211            }
212    
213            /**
214            * Returns the website of this announcements delivery.
215            *
216            * @return the website of this announcements delivery
217            */
218            @Override
219            public boolean getWebsite() {
220                    return _announcementsDelivery.getWebsite();
221            }
222    
223            @Override
224            public int hashCode() {
225                    return _announcementsDelivery.hashCode();
226            }
227    
228            @Override
229            public boolean isCachedModel() {
230                    return _announcementsDelivery.isCachedModel();
231            }
232    
233            /**
234            * Returns <code>true</code> if this announcements delivery is email.
235            *
236            * @return <code>true</code> if this announcements delivery is email; <code>false</code> otherwise
237            */
238            @Override
239            public boolean isEmail() {
240                    return _announcementsDelivery.isEmail();
241            }
242    
243            @Override
244            public boolean isEscapedModel() {
245                    return _announcementsDelivery.isEscapedModel();
246            }
247    
248            @Override
249            public boolean isNew() {
250                    return _announcementsDelivery.isNew();
251            }
252    
253            /**
254            * Returns <code>true</code> if this announcements delivery is sms.
255            *
256            * @return <code>true</code> if this announcements delivery is sms; <code>false</code> otherwise
257            */
258            @Override
259            public boolean isSms() {
260                    return _announcementsDelivery.isSms();
261            }
262    
263            /**
264            * Returns <code>true</code> if this announcements delivery is website.
265            *
266            * @return <code>true</code> if this announcements delivery is website; <code>false</code> otherwise
267            */
268            @Override
269            public boolean isWebsite() {
270                    return _announcementsDelivery.isWebsite();
271            }
272    
273            @Override
274            public void persist() {
275                    _announcementsDelivery.persist();
276            }
277    
278            @Override
279            public void setCachedModel(boolean cachedModel) {
280                    _announcementsDelivery.setCachedModel(cachedModel);
281            }
282    
283            /**
284            * Sets the company ID of this announcements delivery.
285            *
286            * @param companyId the company ID of this announcements delivery
287            */
288            @Override
289            public void setCompanyId(long companyId) {
290                    _announcementsDelivery.setCompanyId(companyId);
291            }
292    
293            /**
294            * Sets the delivery ID of this announcements delivery.
295            *
296            * @param deliveryId the delivery ID of this announcements delivery
297            */
298            @Override
299            public void setDeliveryId(long deliveryId) {
300                    _announcementsDelivery.setDeliveryId(deliveryId);
301            }
302    
303            /**
304            * Sets whether this announcements delivery is email.
305            *
306            * @param email the email of this announcements delivery
307            */
308            @Override
309            public void setEmail(boolean email) {
310                    _announcementsDelivery.setEmail(email);
311            }
312    
313            @Override
314            public void setExpandoBridgeAttributes(
315                    com.liferay.portal.model.BaseModel<?> baseModel) {
316                    _announcementsDelivery.setExpandoBridgeAttributes(baseModel);
317            }
318    
319            @Override
320            public void setExpandoBridgeAttributes(
321                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
322                    _announcementsDelivery.setExpandoBridgeAttributes(expandoBridge);
323            }
324    
325            @Override
326            public void setExpandoBridgeAttributes(
327                    com.liferay.portal.service.ServiceContext serviceContext) {
328                    _announcementsDelivery.setExpandoBridgeAttributes(serviceContext);
329            }
330    
331            @Override
332            public void setNew(boolean n) {
333                    _announcementsDelivery.setNew(n);
334            }
335    
336            /**
337            * Sets the primary key of this announcements delivery.
338            *
339            * @param primaryKey the primary key of this announcements delivery
340            */
341            @Override
342            public void setPrimaryKey(long primaryKey) {
343                    _announcementsDelivery.setPrimaryKey(primaryKey);
344            }
345    
346            @Override
347            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
348                    _announcementsDelivery.setPrimaryKeyObj(primaryKeyObj);
349            }
350    
351            /**
352            * Sets whether this announcements delivery is sms.
353            *
354            * @param sms the sms of this announcements delivery
355            */
356            @Override
357            public void setSms(boolean sms) {
358                    _announcementsDelivery.setSms(sms);
359            }
360    
361            /**
362            * Sets the type of this announcements delivery.
363            *
364            * @param type the type of this announcements delivery
365            */
366            @Override
367            public void setType(java.lang.String type) {
368                    _announcementsDelivery.setType(type);
369            }
370    
371            /**
372            * Sets the user ID of this announcements delivery.
373            *
374            * @param userId the user ID of this announcements delivery
375            */
376            @Override
377            public void setUserId(long userId) {
378                    _announcementsDelivery.setUserId(userId);
379            }
380    
381            /**
382            * Sets the user uuid of this announcements delivery.
383            *
384            * @param userUuid the user uuid of this announcements delivery
385            */
386            @Override
387            public void setUserUuid(java.lang.String userUuid) {
388                    _announcementsDelivery.setUserUuid(userUuid);
389            }
390    
391            /**
392            * Sets whether this announcements delivery is website.
393            *
394            * @param website the website of this announcements delivery
395            */
396            @Override
397            public void setWebsite(boolean website) {
398                    _announcementsDelivery.setWebsite(website);
399            }
400    
401            @Override
402            public com.liferay.portal.model.CacheModel<com.liferay.portlet.announcements.model.AnnouncementsDelivery> toCacheModel() {
403                    return _announcementsDelivery.toCacheModel();
404            }
405    
406            @Override
407            public com.liferay.portlet.announcements.model.AnnouncementsDelivery toEscapedModel() {
408                    return new AnnouncementsDeliveryWrapper(_announcementsDelivery.toEscapedModel());
409            }
410    
411            @Override
412            public java.lang.String toString() {
413                    return _announcementsDelivery.toString();
414            }
415    
416            @Override
417            public com.liferay.portlet.announcements.model.AnnouncementsDelivery toUnescapedModel() {
418                    return new AnnouncementsDeliveryWrapper(_announcementsDelivery.toUnescapedModel());
419            }
420    
421            @Override
422            public java.lang.String toXmlString() {
423                    return _announcementsDelivery.toXmlString();
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            @Override
447            public AnnouncementsDelivery getWrappedModel() {
448                    return _announcementsDelivery;
449            }
450    
451            @Override
452            public boolean isEntityCacheEnabled() {
453                    return _announcementsDelivery.isEntityCacheEnabled();
454            }
455    
456            @Override
457            public boolean isFinderCacheEnabled() {
458                    return _announcementsDelivery.isFinderCacheEnabled();
459            }
460    
461            @Override
462            public void resetOriginalValues() {
463                    _announcementsDelivery.resetOriginalValues();
464            }
465    
466            private final AnnouncementsDelivery _announcementsDelivery;
467    }