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